Hi,
I'm a newbie trying to write a script to fill in a cell value if its row is selected. The use case I have in mind is as follow: during exploratory data analysis I select some points in a graph which I suspect to be outliers. I have another script which helps me look at the raw data (not part of the JMP table), and based on looking at that raw data I decide the row corresponding to this data point should be excluded from my analysis (i.e. the raw data used to generate that particular row is garbage). I can simply right click and select "Exclude". Now all my JMP analysis looks at only the good data points which is fine and dandy. Now after I finish all this analysis I want to go back and do some analysis on the rows that I excluded. For instance, if each row represents data collected by different operators, maybe one operator is producing a lot of junk data. I can of course do a point and click solution to select all excluded rows and create a new subset datatable, but what I would prefer to do is add a new column (let's call it FlagColumn) and set all the selected rows in FlagColumn to "bad" and all the other rows to "good". What I have in mind is something like this:
dt = current data table();
rows = dt << get selected rows ;
For( i=1,
i<=5,
i++,
if(Row State(i) == Selected State(1),
dt:FlagColumn[i] = 0
);
);
But this doesn't seem to do anything - I think I don't understand how to setup the condition in the if statement correctly. Also, I have not yet figured out how to get the number of rows in the table (so for testing purposes at the moment I just set the index i in the for loop to run from 1 to 5). Any suggestions? Thanks in advance!