- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Conditional formatting in a data table
Hi. Does anyone know how to do conditional formatting in a data table column? For example, I want to have the cells in a specific column to turn red when the value is greater than or equal to 0.20. I have found instructions on how to do this in a report but not a data table.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Conditional formatting in a data table
Hi @Michelle_Martin,
Have you tried the Color Gradient column property? Right-click the column you want to format > Column Info. Then, add the Color Gradient column property, check the box to "Color Cell by Value," and click the gradient to set the color theme (or define your own). To have a sharp cut-off, set the Minimum and Center to the same value, and the Max to one unit higher.
I hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Conditional formatting in a data table
Here's an example with Big Class where I color cells red if the age is > 14:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where(:Age > 14);
:Age << Color Cells( "Red" );
dt << Clear Select;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Conditional formatting in a data table
Hi,
I kind of use your code, then I found if there's no cell fit the selection, the whole column will be red.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Conditional formatting in a data table
Hi @Michelle_Martin,
Have you tried the Color Gradient column property? Right-click the column you want to format > Column Info. Then, add the Color Gradient column property, check the box to "Color Cell by Value," and click the gradient to set the color theme (or define your own). To have a sharp cut-off, set the Minimum and Center to the same value, and the Max to one unit higher.
I hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Conditional formatting in a data table
Is there anyway to automatically do this for all the columns in the data table? Through scripting or the column info tab
Solved: Standardize Attributes. Didn't see a delete button for replies so I can't delete this ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content