I want to highlight significant PValues in a Data Table Box. I have a display where I simply run a Response Screening then save the data table to the display along with a Graph Builder plot via: vlb << Append(dtb = Data Table Box(dt));
I can't seem to figure out an easy way to edit the Data Table Box. I tried highlighting the value on the actual table before import into the display but it didn't do anything. Any suggestions?
Duh, sorry I JMPed in too early. But just in case that's the only route that'll give you the formatting, here is a utility:
Data Table To Table Box = Function({dt},{Default Local},
tb = Table Box();
For (i=1,i<=NCols(dt),i++,
col = Column(dt,i);
colName = col << Get Name;
lstValues = col << Get Values;
type = col << Get Data Type;
If (type=="Character",
tb << Append(
String Col Box(colName,lstValues)
)
,
tb << Append(
Number Col Box(colName,lstValues)
)
);
);
// return
tb
);
I'm not sure if there is a way to change the background colour, but you can apply conditional p-value formatting:
NumberColBox("p-value",EvalList({p}),<<Set Format(10,97),<<Set Conditional Format("PValue")),
This doesn't look like a solution for a Data Table Box?
Duh, sorry I JMPed in too early. But just in case that's the only route that'll give you the formatting, here is a utility:
Data Table To Table Box = Function({dt},{Default Local},
tb = Table Box();
For (i=1,i<=NCols(dt),i++,
col = Column(dt,i);
colName = col << Get Name;
lstValues = col << Get Values;
type = col << Get Data Type;
If (type=="Character",
tb << Append(
String Col Box(colName,lstValues)
)
,
tb << Append(
Number Col Box(colName,lstValues)
)
);
);
// return
tb
);
Beautiful, I think I can take it from here along with your previous comment. It's unfortuneate the Data Table Box() isn't a Table Box(). All the documentations say it is, but when I dig into the properties I feel very limited in my options for customization.
Thanks for the elegant function! Not sure why I didn't think of it. That's what community is for!
If you are OK with not having the live link to the data table like the DataTableBox has, the Get As Report message should do you just fine.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:Age << Color Cells( "Red" );
New Window("Colored cells",
dt << get as report()
);
Thanks for sharing! This is actually a better solution to my specific problem. However, I'm going to leave David's answer as correct since I believe it's more robust.