subset a table with category in a column and name the sub tables with the cat. name;
I wrote a short script as below but it name both table as "F" and "F2", rather than "F" and "M". Anything I did wrongly?
Names default to here(1);
dtsumm = dt << Summary(
Group( :sex )
dt<<select where(dt:sex==dtsumm:sex)<< subset(Output Table Name(:sex));
Go to Solution
I think where you are using :sex for the output table name you just need to replace it with dtsumm:sex. Its picking up the values from the source table not the summary table.
View solution in original post
Dave@Pega-Analytics is right. It's always good practice to scope your references.
Alternatively, you could let JMP do the subsetting by categories using the By() option in Subset():
Data Table( "Big Class.jmp" ) << Subset( By( :sex ), All rows, Selected columns only( 0 ), columns( :name, :age, :height, :weight ))
Data Table( "Big Class.jmp" ) << Subset(
By( :sex ),
Selected columns only( 0 ),
columns( :name, :age, :height, :weight )
No need for the Summary() or the For() loop.
need the loop in following processes. just use the example table to show the problem I had.
There are no labels assigned to this post.