names default to here(1);
dt1 = New Table( "Example",
Add Rows( 10 ),
New Script(
"Source",
Data Table( "Untitled 31" ) << Split(
Split By( :Column 2 ),
Split( :Column 1 ),
Sort by Column Property
)
),
New Column( "Bin",
Character,
"Nominal",
Set Values(
{"1001", "1001", "1001", "1001", "1002", "1002", "1002", "1002", "1003",
"1003"}
)
),
New Column( "TOF",
Character,
"Nominal",
Set Values( {"Y", "N", "N", "Y", "N", "N", "N", "Y", "Y", "Y"} )
),
New Column( "RWED",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Selected,
Set Values( [1, ., ., 1, ., ., ., 1, 1, 1] )
),
New Column( "MP",
Character,
"Nominal",
Set Values(
{"31A", "31A", "31A", "31A", "31A", "31B", "31B", "31B", "31A", "31B"}
)
)
);
dt2 = dt1 << Summary(
Group( :Bin, :MP ),
Sum( :RWED ),
Freq( "None" ),
Weight( "None" )
);
dt2:Name("Sum(RWED)") << set name( "TRWED" );
dt2 << NewColumn("RWRat", Numeric, Continuous, Formula(Round(:TRWED / :N Rows* 100, 2) ));
dt3 = dt2 << Transpose(
columns( :RWRat ),
By( :Bin ),
Label( :MP ),
Output Table( "\!"RWRT By (TXN_WW, MP" )
);
Jim