MMMM i am not sure...my script skills are subpar. Here is my whole code. It runs okay upto the loop section with the summary step.
t1 = Open( "C:\Users\ClaireR\Desktop\Example\ExampleABC.jmp" );
For( i = 1, i <= 5, i++,
dt1 << New Column( "Scenario", Numeric, "Continuous", Formula( :Place ID - i ) );
dt1 << New Column( "Box",
Character,
"Nominal",
Formula(
If( (:Place ID - i) <= 200,
"Ground",
If( (:Place ID - i) <= 250,
"Drop 1",
If( (:Place ID - i) <= 400,
"Ground",
If( (:Place ID - i) <= 450,
"Drop 2",
If( (:Place ID - i) <= 600,
"Ground",
If( (:Place ID - i) <= 650,
"Drop 3",
If( (:Place ID - i) <= 800,
"Ground",
If( (:Place ID - i) <= 850,
"Drop 4",
"Ground"
)
)
)
)
)
)
)
)
)
);
dt1 << New Column( "ActualLoc",
Character,
"Nominal",
Formula(
If( (:Place ID - i) <= 200,
"Ground",
If( (:Place ID - i) <= 250,
:Place ID 2,
If( (:Place ID - i) <= 400,
"Ground",
If( (:Place ID - i) <= 450,
:Place ID 2,
If( (:Place ID - i) <= 600,
"Ground",
If( (:Place ID - i) <= 650,
:Place ID 2,
If( (:Place ID - i) <= 800,
"Ground",
If( (:Place ID - i) <= 850,
:Place ID 2,
"Ground"
)
)
)
)
)
)
)
)
)
);
);
:Scenario << Set Name( "Scenario 1" );
:Box << Set Name( "Box 1" );
:ActualLoc << Set Name( "ActualLoc" );
mrj = {};
For( j = 1, j < 3, j++,
newDT = dt1 << Summary(
Group( Box[j] ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 ),
output table name( "Sum " || Char( j ) )
);
Insert Into( mrj, newDT );
);