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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
inam6713
Contributor
Contributor

Pivot Table Background Color for Min & Max Sales Value by Month Not Working Correctly in Qlik Cloud

Hi Qlik Community,

I’m working on a pivot table in Qlik Cloud and trying to implement a background color expression for highlighting monthly min and max valuesonly for the Category "Sales".

My Setup:

Dimensions:

  1. BUSINESS_DATE_MONTH_YEAR → format: YYYY_MM

  2. Week_Year → format: YYYY_WEEK

  3. [Final Formatted Date] → format: D-DAY-MMM-YYYY

Category Values: Only two – Sales and Encashment

Expressions:

Expression 1:

Sum(If(segregate = 'TCIL', INR_PAYMENT_USD))
 

Background Color:

If(Category = 'Sales', 'Green()', If(Category = 'Encashment', 'Yellow()'))
 

Expression 2:

Sum(If(segregate = 'CHANNEL', INR_PAYMENT_USD))
 

Background Color:

If(Category = 'Sales', 'Green()', If(Category = 'Encashment', 'yellow'))
 

Expression 3:

Column(1) + Column(2)
 

Background Color:

If(Category = 'Sales', 'Green()', If(Category = 'Encashment', 'Yellow()'))

Requirement:

I want to highlight the max value in blue and the min value in red (per month) only for "Sales" Category in Expression 1.

My Current Background Color Expression for Expression 1:

If(
Sum(If(segregate='TCIL', INR_PAYMENT_USD)) =
Max(TOTAL Aggr(Sum(If(segregate='TCIL', INR_PAYMENT_USD)), [Final Formatted Date])),
'Black()',
If(
Sum(If(segregate='TCIL', INR_PAYMENT_USD)) =
Min(TOTAL Aggr(Sum(If(segregate='TCIL', INR_PAYMENT_USD)),[Final Formatted Date])),
'Red()',
If(Category = 'Sales', 'Green()',
If(Category = 'Encashment', 'Yellow()'))
))

Problem:

  • Only the min value is getting highlighted in some months.

  • Max value is not getting highlighted at all.

Question:

How can I fix the expression to correctly highlight min (red) and max (blue) values for each month only when Category = 'Sales'?

Any help would be appreciated!

Labels (4)
0 Replies