I have data table with multiple columns and rows
I want to loop through each column and add it to graph builder on x -axis
This is my simple script
dt = Open( filepath );
all_cols = dt << Get Column Names( "String" );
cols_to_plot={};
For Each ({col}, all_cols,
If(col == "A" || col == "B",,
Insert into (cols_to_plot, col);
)
);
graph = dt << Graph Builder();
For Each ({col},cols_to_plot,
graph << Add Variable ("X", Column(dt, col)); // Also tried graph << Add Variable (X, Column(dt, col));
);
This script is always giving me below error
argument value is invalid in access or evaluation of 'Add Variable' , Bad Argument( "X" ), Add Variable( "X", Column( dt, col ) ) /*###*/at line 600
Just as a check if I run below script it works fine, but I want to plot it for ~1000 columns
graph = dt << Graph Builder(
Variables(X(cols_to_plot[1]),X(cols_to_plot[2]),X(cols_to_plot[3]));
);
what am I missing here, appreciate your help
Edit (jthi): added jsl formatting