I'm looking to add column reference lines based on data from another data able. An example, using "Big Class" would update columns "weight' and "height" with P50 and P95 values from a lookup data table.
The rows on the lookup data table correspond to the column names in the main table. The reference lines would need to assign the label value from the lookup table column name "P50" or "P95" and the value is from the row in that column.
Example showing the added column axis reference lines:

Example for Lookup data table:

I'm not very well versed in JSL so I appreciate any help that comes my way on this topic. I've created a script but it's not doing what I want.
It seems to corrupt the column, sometimes when plotting a distribution it is showing all '0' values. Also, if I'm trying to add both P50 and P95 ref lines, only the last one is saved to the column and it saves it on both columns.
dt = Open ("C:\Program Files\SAS\JMP\15\Samples\Data\big class.jmp");
dtLookup = New Table( "Lookup Table",
Add Rows( 2 ),
New Column( "Column Name",
Character,
Nominal,
Set Values( {"weight", "height"} )
),
New Column( "P50",
"Continuous",
Set Values( [100, 61] )
),
New Column( "P95",
"Continuous",
Set Values( [120, 70] )
)
);
col_name_list = dt << get column names(string);
col_name_list_lookup = dtLookup << get column names(string);
numRowsLookup = N Rows( dtLookup );
numColsLookup = N Cols( dtLookup );
for(n=1,n<=numRowsLookup,n++,
col_name = dtLookup[n,1];
If(contains(col_name_list,col_name),
for(j=2,j<=numColsLookup,j++,
col = Column(dt, col_name);
col_name_Lookup = col_name_list_lookup[j];
value = Column(dtLookup,col_name_Lookup)[n];
col <<
Set Property("Axis",
{
//Add Ref Line( 63, "Dashed", "Orange", "P50", 2 )
Add Ref Line( value, "Dashed", "Orange", col_name_Lookup, 2 )
});
);
);
);
Thank you,
Roger