subset a table with category in a column and name the sub tables with the cat. name<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />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);
dt=open("$SAMPLE_DATA/big class.jmp");
dtsumm = dt << Summary(
Group( :sex )
);
for(x=1,x<=nrow(dtsumm),x++,
dt<)<< subset(Output Table Name(:sex));
);
Re: subset a table with category in a column and name the sub tables with the cat. nameneed the loop in following processes. just use the example table to show the problem I had.
Re: subset a table with category in a column and name the sub tables with the cat. nameDave@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 ))
No need for the Summary() or the For() loop.
Re: subset a table with category in a column and name the sub tables with the cat. nameI 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.