Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
rkspareek1992
Partner - Creator
Partner - Creator

Row wise comparison in Pivot table

Hi,

I have three tables A, B & C. In tables A, B & C I have Total target, MTD target and Actual data respectively. I have concatenated all three tables to show the data in below-mentioned form.

    

MTD ProductionLocationTotalsPlant1Plant2Plant3
Month Target (A)3,2362,259620357
MTD Target (B)939656180104
Total Actual (C)1,096619304174

Expression of A, B & C is Sum(Total target), Sum(MTD Target) and Sum(Actual) respectively.

Now I want to compare B and C, if Sum(Actual) <Sum(MTD Target), Red, Green.

and output should be like as:


MTD ProductionLocationTotalsPlant1Plant2Plant3
Month Target (A)3,2362,259620357
MTD Target (B)939656180104
Total Actual (C)1,096619304174

Kindly suggest the expression for color.

2 Replies
karthikoffi27se
Creator III
Creator III

Hi Rakesh,

Under the expression you have color by text (Text Color). Use the expression if (Sum(Actual) <Sum(MTD Target), Red(), Green()).


This should work


Capture.PNG


Many Thanks

Karthik.



rkspareek1992
Partner - Creator
Partner - Creator
Author

I have tried, but its only working for Totals, not for all plants (which are used as columns).

I have also tried as:

if(Sum(<Total Plant>Actual) <Sum(<Total Plant>MTD Target), Red(), Green())