cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
senatorx
Level III

Proper syntax to color cells where column name has a space

Hi, I found in the forums that you can color table cells by sending the color cells(...) command to a table column.

It works fine when sending to a column with no spaces in the column name, such as ":Roast", however a column title with a space fails.  What is the proper syntax for column names with spaces?

Thanks.

---------------------------------------------------------------

coffee_dt = New Table();

coffee_dt << New Column("Coffee Name", Character, Nominal);

coffee_dt << New Column("Roast", Character, Nominal);

coffee_dt << AddRows(2);

Column("Coffee Name")[1] = "Veranda";

Column("Coffee Name")[2] = "Pike Place";

Column("Roast")[1] = "Medium";

Column("Roast")[2] = "Dark";

:Roast << color cells("red", coffee_dt << get rows where(:Roast=="Medium"));

Column("Coffee Name") << color cells("green", coffee_dt << get rows where(Column("Coffee Name")=="Pike Place"));

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Proper syntax to color cells where column name has a space

This syntax works:

:Coffee Name << color cells("green", coffee_dt << get rows where(:Coffee Name == "Pike Place"));

It doesn't like column("Coffee Name") in the where clause for some reason.  If you have strange characters in the column name you can use the :name() construct.  This works:

Column(coffee_dt, "Coffee Name") << color cells("green", coffee_dt << get rows where(:name("Coffee Name")=="Pike Place"));

View solution in original post

1 REPLY 1
pmroz
Super User

Re: Proper syntax to color cells where column name has a space

This syntax works:

:Coffee Name << color cells("green", coffee_dt << get rows where(:Coffee Name == "Pike Place"));

It doesn't like column("Coffee Name") in the where clause for some reason.  If you have strange characters in the column name you can use the :name() construct.  This works:

Column(coffee_dt, "Coffee Name") << color cells("green", coffee_dt << get rows where(:name("Coffee Name")=="Pike Place"));

Recommended Articles