I'm trying to run a similar script like below where I loop through a list of columns, select where they meet a certain criteria and hide/exclude them accordingly.
In my script there are calculations and graphical outputs created and for all of those I'm able to use the approach to select a column and compute it as I show below.
Except for the select where() part:
- If I use the :column(col_w) it ignores it
- If I use :name(col_w) it gives an error that it needs a quoted string and I can't get it to work.
How would I properly script it to get the select where to work?
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col_w = List( "age", "height", "weight" );
For( i = 3, i <= N Items( col_w ), i++,
//i = 1;
cur_col = (col_w[i]);
//cur_col1 = column(col_w[i]);
dt << select where( :column( cur_col ) > 1 ) << hide;
//dt << select where ( :name(cur_col) > 1) << hide; << exclude;
Go to Solution
Your For() loop needs to start with I=1.
Here is the proper form for your Select Where:
dt << select where ( as column(cur_col) > 1); column(dt,cur_col) << hide << exclude;
View solution in original post
Perfect. Thanks. It works now.
I had set the i = 3 as I only wanted to look at one loop to understand the issue and that was the easiest way to do so. But thanks for mentioning it. These little (potential) mistakes can cost one hours to find ...
There are no labels assigned to this post.