Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Nick36
Contributor II
Contributor II

Formatting colours in a table

Hello everyone,

Please I need your help! I am trying to work with colors in a table.

I have two columns in a table, Category and Sales as shown in the attached image.

I want expression in Qliksense to do this  .....↔️ if Sales corresponds to Cat1, apply the color of the cat1 (apply green for example);

Thanks in advance for your contributions.

5 Replies
micheledenardi
Specialist II
Specialist II

Put a formula like this in the "backgroup color expression" or "Text Color expression" of your table: 

 

if(Category='Cat1',green(),red())

 

 

2022-02-10 11_18_54-Window.png

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Nick36
Contributor II
Contributor II
Author

Thank you very much@Micheledenardi for your quick reply, 

Is it possible to display the colors in the Sales column only?

micheledenardi
Specialist II
Specialist II

Yes, just specify the "backgroup color expression" or "Text Color expression" only in the Sales measure options

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Nick36
Contributor II
Contributor II
Author

Applying this expression below, only function on the Category column on my end, the colour doesn't display on the Sales column. Am I doing something wrong?

if(Category='Cat1',green(),red())

And also, if I move this expression to the sales measure option, I have to edit it to something like this ... If(Sales = 100, green(),red()). But what I really want is to reference the Category column.

micheledenardi
Specialist II
Specialist II

if you want to color measures by the value of sales you have to put something like this in your measure color expression:

if(sum(Sales)>140,green(),red())

2022-02-10 12_08_17-Window.png

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.