Subset data tableHi all,
From my previous post, i face the subset data problem. I using the hard coding to list down the subset data table one by one.
But now i want dynamic the code, one of the reason that i don't want list down one by one(hard coding ) is if in future I have 50 F D in one dataset, so is impossible to me to list down the F D one by one right?
I try using the script below, but still have errors, and it only print the first f_d's subset data table for me only.
So, how can i do it to iterate until the 5 f_d?(because now i have 5 f_d)
Thanks.
dt = Open( <PATH to="" open="" data="https://community.jmp.com/" table="">);
// Change the column name "F D" to "f_d"" to match the example
dt:F D << set name( "f_d" );
a = {"S_GX_F40", "S_GX_Z40","S_III_E110","S_III_E80","S_III_SL150"};
dt << Select Where( Starts With( :f_d, a[1] ) );<BR />baseDT = dt << Subset( output table name( "Subset" ), selected rows( 1 ), selected columns( 0 ) );<BR />For( i = 1, i <= N Items( a ), i++,<BR />dt << Select Where( Starts With( :f_d, a ) );<BR />TempDT = dt << Subset( output table name( "Subset" ), selected rows( 1 ), selected columns( 0 ) );<BR />baseDT = baseDT << concatenate( TempDT, append to first table( 1 ) );<BR />Close( TempDT, nosave );<BR />);<BR />
</PATH>
Re: Subset data tableI have solve my subset data table problem already
Thanks.
Re: Subset data tableThanks Craige_Hales for reply.
But i now only can generate the individual subset data table.
How can i generate out all the subset data table? i have 5 f_d there, so i need generate out 5 subset data table.
In my coding, i have using loop, but it seems cannot functions.
Thanks
Re: Subset data tableIs the column a character column? In the message there is no subscript on "a" which might mean it is a list rather than an element of the list.
dt = Open( "$sample_data/big class.jmp" );
letters = {"B", "C"};
dt << selectWhere( Starts With( dt:name, letters[2] ) );
dt << subset( selected rows( 1 ) );
Names starting with CNames starting with C
Re: Subset data tableIt keep comes out with this error when i run the script:
argument should be character{1} in access or evaluation of 'Starts With' , Bad Argument( S ), Starts With/*###*/(:f_d, a)
So, how to I solve it?
Thanks.