JSL how to reference a table in graph builderHallo all,
I use a JSL script to generate two tables dt1 and dt1 from an SQL server and then I want graph builder to plot two columns from the first data table I generated. Example below:
dt1 = Open Database( "BLA", "
SELECT col1, col2
FROM BLA", "data table 1" );
dt2 = Open Database( "BLA", "
SELECT col1, col2
FROM BLA", "data table 2" );
Graph Builder(
Variables( X( :col1 ), Y( :Tcol2 ) ),
Elements( Points( X, Y, Legend( 7 ) ) )
);
But graph builder seems to see only the last table I defined (dt2) not dt1. I tried:
Graph Builder(
Variables( X( dt1:col1 ), Y( dt1:Tcol2 ) ),
Elements( Points( X, Y, Legend( 7 ) ) )
);
but it also does not work. How do I manage?
Thanks for your help.
Automation and ScriptingData AccessMass CustomizationRe: JSL how to reference a table in graph builderThank you very much Thierry, that worked! I understand, I will merge the tables if I have to use the data in the same graph builder.
Re: JSL how to reference a table in graph builderI think JMP will set the dt2 as Current Data Table() and because you haven't specified reference for Graph Builder it will use Current Data Table(). To reference datatable you can use dt1 << Graph Builder(...
Here is Graph Builder example from Scripting Index:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Graph Builder(
Variables(X(:Sex), Y(:Height), Group X(:Age)),
Elements(Box Plot(X, Y))
);Re: JSL how to reference a table in graph builderHi,
Specifically, to point to a specific table when working with multiple data tables, you need to point to the table when invoking Graph Builder:
dt1 << Graph Builder(
Variables( X( :col1 ), Y( :Tcol2 ) ),
Elements( Points( X, Y, Legend( 7 ) ) )
);
However, I am not familiar with a method to create a Graph Builder output based on columns selected from two different tables. Hence, you probably need to create a temporary table that contains the desired columns. I'll let others to chime in on this topic.
Best,
TS