names default to here( 1 );
/*****************************************************************************/
// Create a sample data table and original graphs
/*****************************************************************************/
dt = new table(
"Example",
New Column( "Months of Storage" ),
New Column( "Stability Condition", character ),
New Column( "Lot", character ),
New Column( "API001 %LC",format("Percent",4,0) )
);
MoList = {0, 3, 6, 9, 12, 18};
StabList = {"Ambient", "25/60", "30/65", "40/75"};
LotList = {"001", "002", "003", "004", "005", "006"};
For( m = 1, m <= N Items( MoList ), m++,
For( s = 1, s <= N Items( StabList ), s++,
For( l = 1, l <= N Items( LotList ), l++,
For( i = 1, i <= 16, i++,
dt << add rows( 1 );
:Months of Storage[N Rows( dt )] = MoList[m];
:Stability Condition[N Rows( dt )] = StabList[s];
:Lot[N Rows( dt )] = LotList[l];
:Name( "API001 %LC" )[N Row( dt )] = Random Integer( 65, 110 ) / 100;
)
)
)
);
dt << select where( :Months of Storage == 0 & :Stability Condition != "Ambient");
dt << delete rows;
dt << select where( : Stability Condition == "Ambient" & :Months of Storage !=0);
dt << delete rows;
dt:stability condition << set property("value order",{Custom Order( {"Ambient", "25/60", "30/65", "40/75"} )});
dt << Graph Builder(
Size( 570, 488 ),
Show Control Panel( 0 ),
Variables(
X( :Lot ),
Y( :API001 %LC ),
Group X( :Months of Storage ),
Group Y( :Stability Condition )
),
Elements( Points( X, Y, Legend( 7 ), Jitter( "None" ) ) )
);
dt << Graph Builder(
Size( 570, 492 ),
Show Control Panel( 0 ),
Variables(
X( :Months of Storage ),
Y( :API001 %LC ),
Group X( :Stability Condition ),
Group Y( :Lot )
),
Elements( Points( X, Y, Legend( 7 ) ) )
);
// End of initial data table creation and original chart creation
/*****************************************************************************/
// Replicate the Ambient Month 0 values to all levels of Stability Condition
/*****************************************************************************/
// Create a new data table of just the Anbient data
dt << select where(:Stability Condition == "Ambient");
dtAmb = dt << subset( selected rows(1), selected columns(0));
// Delete the Stability Condition column
dtAmb << delete columns(:Stability Condition);
// Use the Summary Platform to create a table with just the unique Stability Condition values
dtSum = dt << Summary(
Group( :Stability Condition ),
Freq( "None" ),
Weight( "None" )
);
// Delete the N Rows Column;
dtSum << delete columns(:N Rows);
// Delete the Ambient row
dtSum << select where(:Stability Condition == "Ambient");
dtSum << delete rows;
// Change all of the
// Cartesian Join of the tables to generate all combinations of the two tables
dtJoin = dtSum <<
Join( With( dtAmb ), Cartesian Join );
// Now create a subset data table from the original data table with all non ambient rows
dt << select where( :Stability Condition != "Ambient");
dtNoAmbient = dt << subset(selected rows(1), selected columns(0));
// Concatenate the non ambient data with the data from the cartiesian data
dtNoAmbient << concatenate(dtJoin, append to first table);
// Create the Graph Builder map with the new data table
dtNoAmbient << Graph Builder(
Size( 570, 488 ),
Show Control Panel( 0 ),
Variables(
X( :Lot ),
Y( :API001 %LC ),
Group X( :Months of Storage ),
Group Y( :Stability Condition )
),
Elements( Points( X, Y, Legend( 7 ), Jitter( "None" ) ) )
);
// Clean up the no longer needed data tables
close( dtAmb, nosave );
close( dtSum, nosave );
close( dtJoin, nosave );