Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sunil_Kenth
Former Employee
Former Employee

Highlighting values in Pivot

Hi,

I am trying to figure out how i can highlight values in a pivot table if they are lower than the previous month.

My dimensions are:

Customer

OrderMonth (derived from OrderDate in the script)

OrderMonth is Pivoted and displayed across the top of the table.

Expression:

sum(OrderTotal)

I would like to highlight where ordertotals are declining.

Thanks,

Sunil

1 Solution

Accepted Solutions
Sunil_Kenth
Former Employee
Former Employee
Author

I used the 'before' function and this seemed to work:

if(sum([Order Total]) < before(sum([Order Total])),LightBlue())

Thanks for looking.

View solution in original post

7 Replies
ecolomer
Master II
Master II

You can put an expresion in de Background Color in expression:

if(Order Month < Order Month -1, red())

To put this expression, you need open the + sign in the name of expression

Sunil_Kenth
Former Employee
Former Employee
Author

I used the 'before' function and this seemed to work:

if(sum([Order Total]) < before(sum([Order Total])),LightBlue())

Thanks for looking.

cspencer3
Creator II
Creator II

Could you change the background color or text color of the expression based on the criteria you mentioned. I would possibly make a flag to flag records as current month and previous month. Then you could use this flag in your analysis so that it doesn't get too crazy in the Set Analysis.

Therefore you could do some logic such as

if(sum({<MonthFlag = {'Current''}>}OrderTotal) < sum({<MonthFlag = {'Previous'}>}OrderTotal, rgb(157, 7, 7)

and place this in your text color/background color property of the target expression.

You may also want to use Numbers as your flags as they will be quicker in calculations than strings. Food for thought.

cspencer3
Creator II
Creator II

Sorry, i was too slow to type. When i replied i found out that you found the answer.

Sunil_Kenth
Former Employee
Former Employee
Author

Thanks for taking the time to reply anyway.

Regards,

Sunil

Not applicable

Go to the "Expressions" background color and add this

=if(sum(LineSalesAmount) < before( sum(LineSalesAmount) ),red(),green())

Modify this as required.

Not applicable

Sorry, As my window was opened, I didn't saw that this is already answered..