Hi JMP Community,
I'm trying to build a dynamic Graph Builder
report in JSL where the list of X variables is determined by certain conditions (e.g., flags like includeSite
, includeWW
, etc.). The goal is to flexibly add or remove columns from the X-axis based on runtime logic.
I’ve tried several approaches, including using:
X( :ColumnName )
X( Column("ColumnName") )
Expr( X(...) )
Substitute(...) and Eval(...)
However, I consistently run into errors like:
Name Unresolved: X in access or evaluation of 'X'
Bad Argument( Column(...) )
What I'm looking for is a reliable and correct way to:
-
Dynamically define a list of X-axis variables
-
Pass them to Graph Builder
-
Avoid hardcoding the number of X variables or having to repeat the builder logic
Here’s a simplified version of my goal:
xVars = {};
If( includeSite, Insert Into( xVars, :Site ) );
If( includeWW, Insert Into( xVars, :WW ) );
// add remaining fixed columns...
Graph Builder(
Variables(
// <- How can I inject xVars here properly?
Y( :Measurement )
),
Elements(
Points( Y( :Measurement ) )
)
);
I want to avoid generating multiple separate graph blocks depending on each condition. Is there a supported or recommended way to dynamically build up the X()
list for Graph Builder
?
Thanks in advance!