The function Rows / Row Selection / Name Selection in Colum is very useful.
You can specify a label for the selected and the unselected rows.
The best feature of the function
You can leave an entry empty - then you can write again and again into the same column and collect infos, like grades for studens in the first example.
If you changed your mind, you can also over-ride previous entires.
So, the standard behaviour of the function is:
- just do something if the user entered a value
- default action: override the previous entry.
Unfortunately, the function can just be used for disjunct groups, like grades.
I would like to use the function to collect infos about interesting samples.
For the Big Class Example you could think about sports activities, like in the second example
(here the JSL code, in reality you would go to the menu and open the dialog box )
A problem arises if a student is in 2 teams - then the last call of the function overwrides the entry of the previous one.
Is there some Shift-Click extended version of the function that enables alternative actions like:
- append (perhaps with a clever way to put the commas
- prepend
- delete ?
Example1: grades
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Clear Select << Select Rows( [2, 4, 8, 9, 20, 25, 26, 35, 36] );
wait(2);
dt << Name Selection in Column( Column Name( "grade" ), Selected( "A" ) );
wait(2);
dt<< Clear Select <<Select Rows( [ 14, 17, 18, 19, 23, 31, 38] );
wait(1);
dt <<Name Selection in Column( Column Name( "grade" ), Selected( "B" ) );
wait(1);
dt << Clear Select <<Select Rows( [3, 5, 6, 15, 16, 21, 27, 29, 33, 34, 39, 40] );
wait(1);
dt << Name Selection in Column( Column Name( "grade" ), Selected( "C" ) );
wait(1);
Data Table( "Big Class" ) << Select Where( :grade == "" );
wait(1);
dt << Name Selection in Column( Column Name( "grade" ), Selected( "D" ) );
wait(2);
//change grade;
dt << Clear Select <<Select Rows( [12] );
wait(2);
dt << Name Selection in Column( Column Name( "grade" ), Selected( "A" ) );
Example2: sports activities (unfortunately, append=1 doesn't work)
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column("activity", Character, "Multiple Response");
dt << Clear Select << Select Rows( [2, 4, 8, 9, 20, 25, 26, 35, 36] );
wait(2);
dt << Name Selection in Column( Column Name( "activity" ), Selected( " ,football" ) );
wait(2);
dt << Clear Select << Select Rows( [2, 4, 8, 12, 22, 27, 28, 29, 30] );
wait(1);
dt <<Name Selection in Column( Column Name( "activity" ), Selected( ", Tennis" ), Append=1 );