cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
JB-2
Level I

Issue defining cell value as variable

Hi,

I want to use values from one datatable as reference lines on a Variability plot based on a separate datatable. My current code is below, it hopefully makes sense as shared. I am using JMP 15.2

 

My issue is that when I run all of this at once, I do not get any reference lines on my plot.

However, if I first run only the section before '//SPLIT POINT' and then separately run the section after '//SPLINT POINT', it works without issue (reference lines are visible on my plot).

 

A final point is that if I use 

Target = dt1_spec_limits::Name( "data_column_A" )[1]

instead of 

Target = dt1_spec_limits:Name("Graph_Target_line")[1]

the reference line shows on the plot, even when the whole script is run as one. So I think it is something to do with the calculations updating in the datatable?

 

Any insights would be greatly appreciated, thanks.

 

//join two datatables to create table of spec limits
dt1_spec_limits = dt1_mean_join <<
Join(
With( dt1_std_join ),
By Matching Columns( :Join = :Join ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 )
)
;
//calculate the Target, USL and LSL values
New Column( "Graph_Target_line",
Numeric,
"Continuous",
Format( "Best", 6 ),
Formula( :Name( "data_column_A" ) )
)
;
New Column( "Graph_USL",
Numeric,
"Continuous",
Format( "Best", 6 ),
Formula(
:Name( "data_column_A" ) + 3.15 *
:Name( "data_column_B" )
)
)
;
New Column( "Graph_LSL",
Numeric,
"Continuous",
Format( "Best", 6 ),
Formula(
:Name( "data_column_A" ) - 3.15 *
:Name( "data_column_B" )
)
)
;
//SPLIT POINT
//assign the variables to be used in the Variability plot
USL = dt1_spec_limits :Name("Graph_USL")[1]
;
LSL = dt1_spec_limits:Name("Graph_LSL")[1]
;
Target = dt1_spec_limits:Name("Graph_Target_line")[1]
;
//Plot based on data from one table with the reference lines based on above
Current data table(dt1_plotting_data)
;
Variability Chart(
Y( :Name( "column_1" ) ),
X( :Equipment, :Date, :Time ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Std Dev Chart( 0 ),
SendToReport(
Dispatch(
{"Variability Chart for column_1"},
"2",
ScaleBox,
{
Add Ref Line( 0, "Dotted", "Medium Light Gray", "", 1 ),
Add Ref Line( Target, "Solid", "Medium Dark Green", "Target", 1 ),
Add Ref Line( USL, "Solid", "Medium Dark Red", "USL", 1 ),
Add Ref Line( LSL, "Solid", "Medium Dark Red", "LSL", 1 )}
),
Dispatch(
{"Variability Chart for column_1"},
"Variability Chart",
FrameBox,
{Row Legend(
Tool_MM,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
)
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Issue defining cell value as variable

I suspect that your dt1_spec_limits data table is not completed before the Variability Chart is run.  Try adding 

Wait( 0 );

just before the // SPLIT POINT.

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Issue defining cell value as variable

I suspect that your dt1_spec_limits data table is not completed before the Variability Chart is run.  Try adding 

Wait( 0 );

just before the // SPLIT POINT.

Jim
JB-2
Level I

Re: Issue defining cell value as variable

Thanks very much