Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ahmadov_10
Contributor
Contributor

color columns in Qlik sense pivot table (year condition)

Hi Experts, 

i need to color my background measure  with this condition :

if(YEAR([DATFCH])=2016,RGB(255,0,0),RGB(196,255,255)),
if(YEAR([DATFCH])=2017,RGB(255,199,0),RGB(196,255,255)),
if(YEAR([DATFCH])=2018,RGB(0,144,255),RGB(196,255,255))

i got the result below : he don't accept the condition (=2016 / 2017/ 2018) as an integer and take the ELSE result (second color)

Any help pleasecoco.PNG

1 Reply
BI
Partner - Contributor
Partner - Contributor

HI,

Calculate Year in the background i.e. at script level and then use that YEAR field in condition, 

If(YEAR='2016', RGB(255,0,0) ,

IF(YEAR='2017',RGB(255,199,0),

IF(YEAR='2018',RGB(0,144,255),RGB(196,255,255)

)))

Thanks,
sasi