Hi,
I have a script that performs some calculations, runs some platforms and extracts certain output, and then builds a tab box in a new window. I want to do all of this for each level of some categorical variable that the user specified in my dialog box.
Currently I create individual subsets of the data based on my grouping variable, and then loop through each of those datasets:
dtSubset = dt << Subset( By( Eval( groupVar ) ), Linked, Selected Columns Only( 0 ), All Rows( 1 ), Invisible );
For( i = 1, i <= N Items( unique_groups ), i++,
dt_i = dtSubset[i];
...some code to do stuff
<BR />...append output as a new tab box in my window
);
Essentially all I am doing is coding up my own analysis and wanting a 'By' variable. I am wondering if there is a better or more efficient way to go about this? The main thing I want with the code is to have the output I create be specific for each level, while also still maintaining a connection to the original data table (meaning the plots in my output are interactive still).
As you can see, I create the subsets as Invisible and then within my code I close them at the end of each iteration of the loop.
Thanks,
Robert