Hello,
I am having an issue applying the apropriate trend rules, or "Tests", to control charts using JSL. My data consists on the results of multiples analyses for all the measures lots of a certain product in the last year. The data I am working with is in a stacked format, and the table has columns which contain control and specification limits, as well as 8 columns for all 8 Tests. In the tests columns, each row will have either a 1 or a 0 to indicate if the rule will apply. I have set up a sample table below in a similar format for reference.
Lot ID | Analysis | Result | LCL | UCL | Rule1 | Rule3 | Rule5 |
A | X | 12 | 10 | 18 | 1 | 0 | 0 |
A | Y | 204 | 200 | 215 | 1 | 0 | 1 |
A | Z | 0.8 | 0.5 | 1 | 1 | 1 | 1 |
B | X | 13 | 10 | 18 | 1 | 0 | 0 |
B | Y | 209 | 200 | 215 | 1 | 0 | 1 |
B | Z | 0.7 | 0.5 | 1 | 1 | 1 | 1 |
C | X | 15 | 10 | 18 | 1 | 0 | 0 |
C | Y | 205 | 200 | 215 | 1 | 0 | 1 |
C | Z | 0.8 | 0.5 | 1 | 1 | 1 | 1 |
In this example, there are 3 unique analyses for 3 unique lots. The Result column is unique for each analysis of each lot, but the control limits and trend rules are matched for matching analyses, so for analysis X, only Rule 1 should apply, but for Analysis Z, all 3 rules should apply. I have control charts being plotted using the code below, with minor modifications to column names for the sake of the example:
dt << Control Chart(
Sample Label( :Lot ),
Group Size( 1 ),
KSigma( 3 ),
By( :Analysis ),
Chart Col( :Result, Levey Jennings( Show Zones( 1 ), Shade Zones( 1 ), Test 1( :Rule1[1] ), Test 3( :Rule3[1] ), Test 5( :Rule5[1] ) ) ),
SendToReport(
Dispatch(
{},
"Levey Jennings of Result",
OutlineBox,
{Set Title("Parameter: "||char(:Analysis))}
),
The rest of the code is Dispatch commands to add reference lines, adjust the frame size, etc. Those sections of code are not having issues, so I have omitted them for brevity. As shown above, when adding in the "Test 1", "Test 3" and "Test 5" lines to the Levey Jennings command, I attempted to reference the value of the first row from the respective configuration columns. This way, as the script plots the charts by Analysis, the first row will contain the Trend Rule configuration of the current analysis being plotted. However, when I run the script, it just applies all 3 rules, regardless of if they should be applied for that specific parameter. Can someone help explain how I can get JMP to parse the value from the respective configuration columns and determine if a certain rule should be applied to each chart by Analysis?
I have previously made this work in a split table, but I did so by using a for loop to create a string with the values concatenated into the string, then using the Parse and Eval commands to execute. I'd really prefer not to use a for loop here if it can be avoided, as this is why I am pulling the data in a stacked format in the first place.