Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Brijesh
Contributor II
Contributor II

Conditional Formatting - Qlik Sense

Does anyone know how to conditionally format columns in a pivot table. I have one column that has 4 values. First value is target and the rest are actuals. If the target is  greater than actuals that corresponding cell should be red. If not I want it green. Any thoughts on how I can make it happen?

I was playing with background color expression for the measure but since its just one column that has 4 values I am not sure how to compare them. I have one dimension for the column that has 4 values.  And the measures are on the row. I want to compare the numbers on column 1 vs 2,3,4 and make them red or green depending on whether its greater or lesser than the target.

Brijesh_0-1681847021580.png

 

 

 

Labels (1)
1 Solution

Accepted Solutions
Brijesh
Contributor II
Contributor II
Author

This is what did the trick for me. I am yet to fully incorporate that logic but as you can see the SGO row gets color coded correctly based on the Target column.

if((first([SGO])< [SGO]), green(),
if((first([SGO])> [SGO]), red(),white()))

Brijesh_0-1681930271609.png

 

 

View solution in original post

5 Replies
sandeep-singh
Creator II
Creator II

Try this 

=if(after(index)<= index, green(),red())
[index] to refer to the name of the expression.

vikasmahajan

hi,

Check with this video you can use dimensionality() function to achieve this requirement  

https://www.youtube.com/watch?v=uzXHbhNCykM

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Brijesh
Contributor II
Contributor II
Author

Thanks for your response. It was helpful to learn about the dimensionality function which I am sure will be using in the future,. But my need is compare the actual values on column1 against columns 2,3,4 and format them accordingly. Not sure how Dimensionality can be used for that.

Brijesh
Contributor II
Contributor II
Author

Thanks for the suggestion. Seeing your suggestion helped me figure out the final solution.

Brijesh
Contributor II
Contributor II
Author

This is what did the trick for me. I am yet to fully incorporate that logic but as you can see the SGO row gets color coded correctly based on the Target column.

if((first([SGO])< [SGO]), green(),
if((first([SGO])> [SGO]), red(),white()))

Brijesh_0-1681930271609.png