I know one simple way is:
my_var= 123; [kudos to Tx!]
What I would like to do ist to automatically write a single value into a global macro var based on a condition, something like:
my_var2= (numeric, continuous, formula(if(:Condition1=="yes" & :Condition2 ==23.4, :SourceValue"));
Take the SourceValue value that has Condition1="yes" and Condition2=23.4 and write it into the global macro var MY_VAR2.
I am thankful for every pointer!
Here is one way to do what you are looking for
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Get Rows Where, returns a matrix of all rows that meet the criteria,
// so one needs to select the 1st matrix element
my_var = :weight[(dt << get rows where( :sex == "F" & :height == 66 ))[1]];