Have a look at the following script,
it creates a table, and inside is a script that may perform what you want.
It splits the Features into columns and sets the USL.
I think the same as @jthi , having data with different ranges (or specs) in separate columns makes it easier.
New Table( "test-split",
Add Rows( 9 ),
New Script(
"__split_usl",
cdt = Current Data Table();
Summarize( cdt, spec_lst = by( :Feature ), usl_lst = Mean( :USL ) );
sdt = cdt << Data Table( "test-split" ) <<
Split(
Split By( :Feature ),
Split( :data ),
Remaining Columns( Drop All ),
Sort by Column Property,
Output table( "Split Table with USL" )
);
For( i = 1, i <= N Items( spec_lst ), i++,
Eval(
Eval Expr(
Column( sdt, spec_lst[i] ) <<
Set Property(
"Spec Limits",
{USL( Expr( usl_lst[i] ) ), Show Limits( 1 )}
)
)
)
);
),
New Column( "Feature",
Character,
"Nominal",
Set Values( {"A", "A", "A", "B", "B", "B", "C", "C", "C"} )
),
New Column( "data",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9] )
),
New Column( "USL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Selected,
Set Values( [3, 3, 3, 6, 6, 6, 9, 9, 9] )
)
);
Georg