How to realize If table BB, column C=="Y", then table AA column D result will fill in "Y" too accordingly. Other all values no changeWould you use 2 table as a example to show how to realize:
If table BB, column C=="Y", then table AA column D result will fill in "Y" too accordingly. Other all values no change.
My JMP version is V14. Thanks for your help
Data TableRe: How to realize If table BB, column C=="Y", then table AA column D result will fill in "Y" too accordingly. Other all values no changeHere is a simple script that performs the task that you specified, or at least how I interpreted what you stated.
Names Default To Here( 1 );
bb = Open( "$sample_data/big class.jmp" );
// Change the Sex column name to "C" to match your example
bb:sex << set name( "C" );
// Create a Blank data table with a column called "D"
aa = New Table( "Change", add rows( 40 ), New Column( "D", character ) );
// If a vlaue in row 2 for column C in table referenced by BB == "F",
// then set the same row value in data table AA column D to "F"
If( BB:C[2] == "F",
AA:D[2] = "F"
);
// or using a different notation
If( BB[2,3] == "F",
AA[2,1] = "F"
);
Re: How to realize If table BB, column C=="Y", then table AA column D result will fill in "Y" too accordingly. Other all values no changeYou could add For Each Row around the if statements. See Scripting Index and For Each Row for more details
For Each Row(
If( BB:C == "F",
AA:D = "F"
);
);