Skip to main content
Announcements
You can succeed best and quickest by helping others to succeed. Join the conversation.
cancel
Showing results for
Search instead for
Did you mean:
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
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.

7 Replies
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

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.

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.

Creator II

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

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..

Community Browser