cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
bjbreitling
Level IV

A script works in JMP PRO but not in JMP LIVE to query data and add spec limits to JMP LIVE control chart

Hi, 

I wrote a script that 1) queries a table(myDT) to build a control chart on and 2) another table(specLimitsTable) and 3) a loop that takes data from the second table to set spec limits on table 1. 

 

It works just fine in JMP PRO and steps 1) and 2) work fine in JMP LIVE but when I add the 3rd part it says failed to regenerate when I go to refresh my data. 

 

The JSL that works in JMP PRO is below: 

myDT = Open Database(
    "APP=JMP;DATABASE=BBAnalytics;DRIVER={SQL Server};Description=BB Analytics Data Warehouse;Trusted_Connection=Yes;UID=%_UID_%;WSID=SFX-JPCZ724;SERVER=SFX-DWA01;DBCNAME=SFX-DWA01;",
    "SELECT * FROM [dbo].[DDGSControlChartDataBPX]",
    "myDT"
);
specLimitsTable = Open Database(
    "APP=JMP;DATABASE=BBAnalytics;DRIVER={SQL Server};Description=BB Analytics Data Warehouse;Trusted_Connection=Yes;UID=%_UID_%;WSID=SFX-JPCZ724;SERVER=SFX-DWA01;DBCNAME=SFX-DWA01;",
    "SELECT * FROM [dbo].[PivotSpecLimitsMediansBPXF]",
    "specDTTest"
);

// Iterate over the rows of the spec limits table
For Each Row(specLimitsTable,
    // Get values from the current row
    column_name = Column(specLimitsTable, "Column_Name")[Row()];
    lsl = Column(specLimitsTable, "LSL")[Row()];
    usl = Column(specLimitsTable, "USL")[Row()];

    // Set spec limits for the corresponding column in the main data table
    
    col_ref = Column(myDT, column_name);
    Eval(
	Eval Expr(
		col_ref << Set Property(
			"Spec Limits",
			{LSL( Expr( lsl ) ), USL( Expr( usl ) ),
			Show Limits( 1 )}
		)
	)
););
0 REPLIES 0