I have this defecting level which determines the number of times it will iterate.
dtparms << Subset( By( :Defecting_Level ), All rows, Selected columns only( 0 ), columns( :Parameter, :CL_LL, :CL_UL, :MD_LL, :MD_UL ) );
dtParms1 = Data Table( "Defecting_Level=1" );<BR />dtParms2 = Data Table( "Defecting_Level=2" );
This is the code that needs to iterate depending on how many defecting levels there are. My problem is can I iterate through different tables using the same script? Or how can I repeat this process depending on the number of defecting levels? Like for example, my defecting level is 3. Then this code needs to run three times, iterating through the three tables that has been subset. Thanks
deftb << New Column( "MD1", numeric );
parameters = Column( dtParms1, "Parameter" ) << get values;
deftb_colnames = deftb << get column names( string );
parameters = Associative Array( Eval( parameters ) );
deftb_colnames = Associative Array( Eval( deftb_colnames ) );
parameters << Intersect( deftb_colnames );
params = parameters << get keys;
For( i = 1, i <= N Items( params ), i++,
foundRows = deftb << get rows where( As Column( deftb, dtParms1:Parameter[i] ) < dtParms1:CL_LL[i] & Is Missing( deftb:MD1 ) == 1 );
deftb:MD1[foundRows] = dtParms1:MD_LL[i];
foundRows = deftb << get rows where( As Column( deftb, dtParms1:Parameter[i] ) > dtParms1:CL_UL[i] & Is Missing( deftb:MD1 ) == 1 );
deftb:MD1[foundRows] = dtParms1:MD_UL[i];
);