Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
reporting_neu
Creator II
Creator II

Color line chart by fieldname "Year"

Hello together,

I have a line chart with two dimensions. Month and Year. So I can compare the months in the years.

As an expression I used the following:
sum ({<year = {$ (= max (year)), $ (= max (year) -1), $ (= max (year) -2)}, quarter =, month =,% date =>} au.number)

Because Qlik Sense chooses colors that look too similar, I want to use a formula for my own colors.

I thought of the following formula:

= if (year = max (year) -1, yellow (), if (year = max (year) -2, green (), blue ()))

But it does not work.

Do you have a solution for me?

Labels (1)
  • years

7 Replies
MayilVahanan

Hi @reporting_neu 

Try like below

= if (Year = max (Total Year) -1, yellow (), if (Year = max (Total Year) -2, green (), blue ()))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
reporting_neu
Creator II
Creator II
Author

Thank you for your response. Unfortunately the formula doesn't work 😞

MayilVahanan

Hi @reporting_neu 

its working fine. 

MayilVahanan_1-1606470844903.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
reporting_neu
Creator II
Creator II
Author

Sorry for the missunderstanding. The years are shown as a single line.
And I need a color for every single year.

chart.PNG

MayilVahanan

Hi @reporting_neu 

Can you provide sample qvf file. 

MayilVahanan_0-1606472443047.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
reporting_neu
Creator II
Creator II
Author

I have the "Qlik Sense Enterprise" version. I don't think I can do an export with that. Or do you know how?

reporting_neu
Creator II
Creator II
Author

Can't anyone help?