Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sayadutt
Creator
Creator

Color coding a pivot cell based on value on the earlier cell value

Hi All,

My data looks like below. My requirement is to highlight the cells based on previous value and mark them either Red or Amber.

If the current cell is less than its previous cell, then the value of the current cell should be Red,  

If the current cell is equal to its previous cell, then the value of the current cell should be Amber, 

otherwise default.

Can you please suggest what should be my text color under Edit Expression of a Pivot Table

 

Data:

TeamReleaseMonthTargeted Regression ScenariosAutomatedManual
ADec 1914712225
AJan 2015512233
AFeb 2015210052
BDec 192793274746
BJan 203121305170
BFeb 201055055

 

What I want is: a Pivot Table

TeamReleaseMonthTargeted Regression ScenariosAutomatedManual
ADec 1914712225
AJan 2015512233
AFeb 2015210052
BDec 192793274746
BJan 203121305170
BFeb 201055055

 

1 Solution

Accepted Solutions
sayadutt
Creator
Creator
Author

I somehow managed to solve this by using above() function

View solution in original post

2 Replies
Taoufiq_Zarra

I propose this solution :

on load Script :

Data:
LOAD rowno() as ID,previous(Manual) as P_Manual,previous("Targeted Regression Scenarios") as P_Targeted,previous(Automated) as P_Automated,* INLINE [
    Team, ReleaseMonth, Targeted Regression Scenarios, Automated, Manual
    A, Dec 19, 147, 122, 25
    A, Jan 20, 155, 122, 33
    A, Feb 20, 152, 100, 52
    B, Dec 19, 2793, 2747, 46
    B, Jan 20, 3121, 3051, 70
    B, Feb 20, 105, 50, 55
];

 

then in expression -> Text Color for [Targeted Regression Scenarios]

if([Targeted Regression Scenarios]<P_Targeted,red(),if([Targeted Regression Scenarios]=P_Targeted,yellow()))

same of other expression for example :

if(Automated<P_Automated,red(),if(Automated=P_Automated,yellow()))
if(Manual<P_Manual,red(),if(Manual=P_Manual,yellow()))

 

output :

 

Capture.JPG

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
sayadutt
Creator
Creator
Author

I somehow managed to solve this by using above() function