Hello,
I have a Distribution platform using a column switcher being populated with columns from a list variable. Each of these columns represents a different quality parameter and thus has different limits which are gathered from an SQL query.
Is there a way to dynamically add reference lines to the Distribution platform as the column switcher changes columns? Right now, I have a SendToReport running in a loop for each item, but it ends up with the reference lines for all columns added at once, rather than just the two needed for each column.
An easy way to do this would be if the column switcher supported an "on column change" script - I could then remove the previous ref lines and add the new ones every time it changes. I couldn't find any scripting index info for if something like this is supported.
JMP version: 14
has_limits = {"item 1", "item 2", "item 3"};
dist = dt << Distribution(
Continuous Distribution( Column( "item 1" ), Horizontal Layout( 1 ), Always use column properties( 1 ), Vertical( 0 ), Outlier Box Plot( 0 ) ),
Column Switcher( "item 1", has_limits )
);
For( n = 1, n <= N Items( has_limits ), n++,
tempUCL = Col Max( Column( dt, has_limits[n] || "_UCL" ) );
tempLCL = Col Max( Column( dt, has_limits[n] || "_LCL" ) );
Eval(
Eval Expr(
dist << SendToReport(
Dispatch(
{Expr( has_limits[n] )},
"1",
ScaleBox,
{Add Ref Line( Expr( tempUCL ), "Dashed", "Medium Dark Red", "UCL", 1 ), Add Ref Line(
Expr( tempLCL ),
"Dashed",
"Medium Dark Red",
"LCL",
1
)}
)
)
)
);
);