Choose Language Hide Translation Bar
Community Trekker

Looping for subset data table

Sorry for accidentally delete the previous post.
i now repost my problem again.

Problem 1:

Actually i have done generate out the 5 subset data table, but one of my problem is when i run out the subset script, it straight generate out all the 5 subset data table right?, then how can i declare when subset data table1= S_GX_F40, subset data table2 = S_GX_F40 etc from the subset data table. Below i my script for generate out the subset data table.


Problem 2:

I have summarize out the summary for the subset data table, actually what i want do is each of the subset data table has summary (what i summarize out the script is for all subset data table). But when i run the script, it only show the last product (S(first script)-in my script) in the log window.So, how can i make all product have summary that i script out, because i need use the name(eg:I_P2A GSVT .6/.045, I_N2A GSVT.3/.045 ) to generate out the chart. Although i have change the product name to the first product, but it also generate out the last product of the variability chart(see the second code for summarize part).And I try to use looping, but it turn out some errors to me.


So, can anyone give me some suggestion or do have any alternative way to solve my both problem?



dt = Open( "<path for open the file>", "invisible" );

S = {"S_GX_F40", "S_GX_Z40","S_III_E110","S_III_E80","S_III_L150"};

//Subset the data table
For( i = 1, i <= N Items( S ), i++,
dt:F D << set name( "f d" );
dt << Select Where(Starts With( dt:f d, S[i] ) ) ;

baseDT = dt << Subset( output table name( "Subset" ), selected rows( 1 ), selected columns( 0 ), "invisible");

//dt << Select Where(Starts With( dt:f d, S[1] ) );

//TempDT = dt << Subset( output table name( "Subset" ), selected rows( 1 ), selected columns( 0 ), "invisible");

//Close( TempDT, nosave );
 //Summary of the subset data table	

dtSub = baseDT << Summary( Group( :Name( "L_T" ), :Name( "F_V_L" ), :Name( "I_P2A GSVT" ), :Name( "I_N2A GSVT.3/.045" ), :Name( "I_P3G_G_PSVT_0.6/0.06" ), :Name( "I_P3HG_G_PHVT_0.6/0.06" ), :family device ), Mean( :Name( "G_Y" ) ), Mean( :NEW_I_P2A ), Mean( :NEW_I_N2A ), Mean( :Name( "NEW_I_P3G_G_PSVT_0.6/0.06" ) ), Mean( :Name( "NEW_I_P3HG_G_PHVT_0.6/0.06" ) ), Freq( "None" ), Weight( "None" ), invisible ); dtSub << Variability Chart( Y(:Name( "I_P2A_GSVT" ) ,:Name( "I_N2A" ) ) , X( :Name( "L_T" ), :Name( "F_V_L" ) ), Analysis Type( "Choose best analysis (EMS REML Bayesian)" ), Std Dev Chart( 0 ), Select Where(dt:f d )


0 Kudos