// I want to create journal of varcharts for a list of columns in a dataset with different legends. a legend column is mentioned which would change in reality for each loop. everything works expect the new column formula does not work. <BR />//In this example, i have used a static legend value of "ABC" but this would change for every loop in reality. the issue is the new formula column does not evaluate the column name <BR /><BR />dt = current data table();
mycolumnList = {"species","subject","season"};
For( i = 1, i <= N Items(mycolumnList), i++,
Try(dt << delete column("LegendCol"));
legend = "ABC";
Try( dt << New Column( "LegendCol", Formula( If(Column(mycolumnList[i])[Row()] == legend, "first", "rest" ) ) ) );
myvarChart = vlb << append(
dt << Variability Chart(
Y( :miles ),
X( eval(mycolumnList[i]) ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Connect Cell Means( 1 ),
Variability Summary Report( 1 ),
Std Dev Chart( 0 ),
Points Jittered( 1 ),
Show Box Plots( 1 ),
Name( "Show Gauge R&R Specifications Dialog" )(0),
Automatic Recalc( 1 ),
SendToReport(
Dispatch(
{"Variability Chart for SORT@WAFER@T_GOOD"},
"Variability Chart",
FrameBox,
{Row Legend(
Name( "LegendCol" ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Solid" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
));
);Anmol@1996