Hi All,
Hi @uday_guntupalli and @julian,
here i attached the sample table and the jmp script so that you guys can try out and get the idea of what im trying to achieve here. Just change the path to the table of data in your computer.
As you can see in the script, there is a formula (USL and LSL) in the summary for the data table.
So, what i need to do right now is to create another formula that can take the value of USL for plastic and so on and asiggned it to become something like Plastic_USL = 0.4. Then i can use the variable (Plastic_USL) to plot in the plastic distribution graph using sendToReport function. so, same goes to the other list of item in the TYPE column.
i cannot use directly the USL variable because if i use that it will only take the last USL value calculated which is ROCK and plot it in all graph (Plastic, Cotton, Paper, Rock). Then the line for USL will be correct for only 1 graph and wrong for the rest of it.
I have been searching for a way to do this but can not get anywhere and really need help from you guys here. You guys help is really appreciated here!
dt = Open ("C:\*\data_table.csv");
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :NUMERIC_RESULT ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Count Axis( 1 ),
Normal Quantile Plot( 1 )
),
By( :TYPE );
);
Summary(
Group(:TYPE ),
Mean( :NUMERIC_RESULT ),
Std Dev( :NUMERIC_RESULT )
);
New Column( "lower_limit",
Numeric,
Continuous,
Format( "Best", 8 ),
Formula(
LSL = :Name( "Mean(NUMERIC_RESULT)" ) - 6 *:Name( "Std Dev(NUMERIC_RESULT)" )
),
);
New Column( "upper_limit",
Numeric,
Continuous,
Format( "Best", 8 ),
Formula(
USL = :Name( "Mean(NUMERIC_RESULT)" ) + 6 *:Name( "Std Dev(NUMERIC_RESULT)" )
),
);
wait (1);
dr = Fit Group (
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :NUMERIC_RESULT ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Count Axis( 1 ),
Normal Quantile Plot( 1 )
),
By( :TYPE )
);
SendToReport(Dispatch({"Distributions TYPE=Cotton","NUMERIC_RESULT"},"1",ScaleBox,
{Min( LSL - 1 ), Max( USL + 1 ), Inc( 0.005 ), Minor Ticks( 1 ),
Add Ref Line( LSL, Solid, "Medium Dark Red", "", 2 ),
Add Ref Line( USL, Solid, "Medium Dark Red", "", 2 )}
)
);
SendToReport(
Dispatch(
{
"Distributions TYPE=Paper",
"NUMERIC_RESULT"},
"1",
ScaleBox,
{Min(-0.6 ), Max( 1.2 ), Inc( 0.001 ), Minor Ticks( 0 ),
Add Ref Line( USL, Solid, "Medium Dark Red", "", 2 ),
Add Ref Line( LSL, Solid, "Medium Dark Red", "", 2 )}
)
);
SendToReport(
Dispatch(
{
"Distributions TYPE=Plastic",
"NUMERIC_RESULT"},
"1",
ScaleBox,
{Min( 0.1 ), Max( 0.4 ), Inc( 0.005 ), Minor Ticks( 0 ),
Add Ref Line( USL, Solid, "Medium Dark Red", "", 2 ),
Add Ref Line( LSL, Solid, "Medium Dark Red", "", 2 )}
)
);
SendToReport(
Dispatch(
{
"Distributions TYPE=Rock",
"NUMERIC_RESULT"},
"1",
ScaleBox,
{Min( 0.01 ), Max( 3.5 ), Inc( 0.01 ), Minor Ticks( 0 ),
Add Ref Line( USL, Solid, "Medium Dark Red", "", 2 ),
Add Ref Line( LSL, Solid, "Medium Dark Red", "", 2 )}
)
);
)<<report;