Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Dafna2020
		
			Dafna2020
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I defined colors for a conditional background:
KPIsColors:
//1=Red,2=light red,3=yellow,4=light green,5=green
LOAD *,Dual(_PickColorExp,_PickColorCodeNum) as PickColorRGB INLINE [
_PickColorCodeNum , _PickColorExp
1 , 'RGB(234,102,83)'
2 , 'RGB(245,183,175)'
3,  'RGB(230,219,91)'
4,  'RGB(172,209,24)'
5,  'RGB(111,149,21)'
];
 
Each condition compares a metric to 5 limits:
=Pick(num(PickColorRGB),
     ($(eYoYGrowth%_PrevYear) <=vRed%)*-1,
     ($(eYoYGrowth%_PrevYear) <=vLightRed%)*-2,
     ($(eYoYGrowth%_PrevYear) <=vYellow%)*-3,
     ($(eYoYGrowth%_PrevYear) <=vLightGreen%)*-4,
     ($(eYoYGrowth%_PrevYear)>vLightGreen%)*-5)
But the Pick function does not work as expected..
There is no background color..
Any Idea why?
Thanks!
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I think this is not the correct way to map the colors. You need to check first expression condition and then define the color there. May be you can try something like below
Pick(match(-1,
     ($(eYoYGrowth%_PrevYear) <=vRed%),
     ($(eYoYGrowth%_PrevYear) <=vLightRed%),
     ($(eYoYGrowth%_PrevYear) <=vYellow%),
     ($(eYoYGrowth%_PrevYear) <=vLightGreen%),
     ($(eYoYGrowth%_PrevYear)>vLightGreen%)),
RGB(234,102,83),
RGB(245,183,175),
RGB(230,219,91),
RGB(172,209,24),
RGB(111,149,21))
 
					
				
		
 Arthur_Fong
		
			Arthur_Fong
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try:
=Pick(match(_PickColorCodeNum,1,2,3,4,5)
     ($(eYoYGrowth%_PrevYear) <=vRed%)*-1,
     ($(eYoYGrowth%_PrevYear) <=vLightRed%)*-2,
     ($(eYoYGrowth%_PrevYear) <=vYellow%)*-3,
     ($(eYoYGrowth%_PrevYear) <=vLightGreen%)*-4,
     ($(eYoYGrowth%_PrevYear)>vLightGreen%)*-5)
 Dafna2020
		
			Dafna2020
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Thank you...
Tried.. but it doesn't work..
 
					
				
		
 Arthur_Fong
		
			Arthur_Fong
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You have a sample app?
 Dafna2020
		
			Dafna2020
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		No...
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I think this is not the correct way to map the colors. You need to check first expression condition and then define the color there. May be you can try something like below
Pick(match(-1,
     ($(eYoYGrowth%_PrevYear) <=vRed%),
     ($(eYoYGrowth%_PrevYear) <=vLightRed%),
     ($(eYoYGrowth%_PrevYear) <=vYellow%),
     ($(eYoYGrowth%_PrevYear) <=vLightGreen%),
     ($(eYoYGrowth%_PrevYear)>vLightGreen%)),
RGB(234,102,83),
RGB(245,183,175),
RGB(230,219,91),
RGB(172,209,24),
RGB(111,149,21))
 Dafna2020
		
			Dafna2020
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It works!
I used variables for the colors...:
Pick(match(-1,
$(eYoYGrowth%_PrevYear) <=vRed%,
$(eYoYGrowth%_PrevYear) <=vLightRed%,
$(eYoYGrowth%_PrevYear) <=vYellow%,
$(eYoYGrowth%_PrevYear) <=vLightGreen%,
$(eYoYGrowth%_PrevYear)>vLightGreen%),
$(vRGBRed),$(vRGBLightRed),$(vRGBYellow),$(vRGBLightGreen),$(vRGBGreen))
Thanks!
