Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Dynamic colors based on a dimension

Hello
I have a barchart with Fiscal year as the dimension and I got an expression
the fiscal years in the data are the following :
FY.23, FY.24, FY.25, and FyY.26 for actuals and FY.23, FY.24, FY.25, FyY.26, FY.27 for budget and forecast
I want to color the bars gradually from Fy.23 as dark gray, then this color would be brigther for Fy.24, brigher for FY.25 than Fy.24 but Green for Fy.26 (this for the actuals)
while for budget I want the same for 23,24, and 25, and finally Fy26, and 27 are both colored green

Kindly advise on how to accomplish this knowing that next year we'll have data for FY.28 and thus FY.27, and FY.28 would be green
is this feasible?

I can walk on water when it freezes
Labels (2)
1 Solution

Accepted Solutions
ali_hijazi
Partner - Master II
Partner - Master II
Author

managed to do it:

ali_hijazi_0-1764924392599.png

I used the ColorMix function which takes 3 paramters
param1 is a number between 0 and 1 and I put it as the (fiscal_year - min(fiscal year)) / max(fiscal_year)-min(fiscal_year)
param2: is the color when value is 0 which is RGB(211,211,211)
param3: is the color when value is 1 which is in my case I chose red RGB(237,41,100)

I can walk on water when it freezes

View solution in original post

1 Reply
ali_hijazi
Partner - Master II
Partner - Master II
Author

managed to do it:

ali_hijazi_0-1764924392599.png

I used the ColorMix function which takes 3 paramters
param1 is a number between 0 and 1 and I put it as the (fiscal_year - min(fiscal year)) / max(fiscal_year)-min(fiscal_year)
param2: is the color when value is 0 which is RGB(211,211,211)
param3: is the color when value is 1 which is in my case I chose red RGB(237,41,100)

I can walk on water when it freezes