Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
k_burata
Creator
Creator

Comparing values in Pivot Table

Hi,

I have a pivot table shown below in which I need to compare value between actual and budget.  What should happen is that on the Actual Row it should shade it with Red to indicate that Actual is > Budget.

     Capture.PNG

Background Color Expression:

If([Type] = 'ACTUAL' and Sum({<Type={'ACTUAL'}>}Value) > Sum({<Type={'BUDGET'}>}Value), Red())

Can somebody point me into the right direction?

Cheers,

1 Solution

Accepted Solutions
sunny_talwar

How about now?

Capture.PNG

If([Stat] = 'ACTUAL' and Sum(TOTAL <Type, Position, Title> {<Stat={'ACTUAL'}>}Value) > Sum(TOTAL <Type, Position, Title> {<Stat={'BUDGET'}>}Value), Red())

View solution in original post

3 Replies
sunny_talwar

Try this may be:

If([Stat] = 'ACTUAL' and Sum(TOTAL <Type> {<Stat={'ACTUAL'}>}Value) > Sum(TOTAL <Type> {<Stat={'BUDGET'}>}Value), Red())


Capture.PNG

k_burata
Creator
Creator
Author

Hi Sunny,

Thanks for the reply.

It is working but when I add a few more data then the formula suddenly breaks.

Capture.PNG

Do I need some more modifiers?

Regards

sunny_talwar

How about now?

Capture.PNG

If([Stat] = 'ACTUAL' and Sum(TOTAL <Type, Position, Title> {<Stat={'ACTUAL'}>}Value) > Sum(TOTAL <Type, Position, Title> {<Stat={'BUDGET'}>}Value), Red())