The script below loads some data and should create twice the same plot.<BR />The first one by referring to the column name by using a variable (test1), the second one by calling the column name directly.
The second one works fine, but for the first one I get an empty plot area. I guess there is a problem with how I define or call test1. I have tried different approaches, but so far nothing worked.
Names Default To Here( 1 );
// Import the Excel file with specified settings
dt = Open(
"/Y:/.../file.xlsx",
Worksheets( "Pivot table for JMP" ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Headers Start on Row( 2 ),
Data Starts on Row( 3 )
)
);
// Filter rows to include only "AAA" in "Common Designation"
dt_AAA = dt << Subset(
Rows( :Common Designation == "AAA" ),
Include All Columns,
Name( "Filtered AAA" )
);
size = "AAA" ;
Match( size,
"AAA", test1 = column ("PL (min)"),
);
New Window( size,
V List Box(
Graph Builder(
Size( 500, 297 ),
Show Control Panel( 0 ),
Variables( X( :test1 ), Y( :Chemistry ), Color( :Chemistry ) ),
Elements( Points( X, Y, Legend( 106 ) ) )
),
Graph Builder(
Size( 500, 297 ),
Show Control Panel( 0 ),
Variables( X( :"PL (min)"n ), Y( :Chemistry ), Color( :Chemistry ) ),
Elements( Points( X, Y, Legend( 106 ) ) )
),
),
);
If I'm understanding correctly, I think you just need to remove the colon in front of test1 in the first Graph Builder script. Here's an example script that works:
Names Default To Here (1);
dt = open ("$SAMPLE_DATA/big class.jmp");
test1 = column ("weight");
Graph Builder (
Variables (X(test1), Y(:height), color (:sex))
);A cool trick to find bugs like this:
remove more and more lines from the buggy script. Till there are just enough lines to produce the error.
important: the code should contain all ingredients to produce the error - for everybody who executes the code *)
This has 2 advantages:
- in most of the cases, one finds the bug automatically. 1 line removed, the bug is gone.
- the remaining code is very short, this makes it much easier to find the bug.
*) on my system, it crashed with the error message:

much better: use one of the sample files, like in @Jed_Campbell 's example.
This has another benefit: you can differentiate between:
- there is an error in my data table (and the error is gone with the example data)
- there is an error in my script (because I can reproduce the error with the sample data)