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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
YoussefBelloum
Champion
Champion

linear trend line one expression two dimensions combo chart

Hi everyone,

I have the barchart below:

Barchart.png

 

I need to add a linear trend line for the last year only, the problem is that when I use the checkbox of the linear trend line, it gives me trend lines for all the years displayed on my barchart (4 trend lines), like the image below:

 

barchart1.png

 

I only need one linear trend line, always for the last year (2020 in this example).

I tried to add another expression and use the linest_m and linet_b functions, but I'm struggling to make it work

I have two dimensions: Quarter and Year

One expression: Sum(X)

Thank you for your time

 

Youssef

Labels (2)
1 Solution

Accepted Solutions
rubenmarin
MVP
MVP

Hi @YoussefBelloum, I'm not sure if this can work, I did a dumb sample and seems to work.

Add another expression as If(Year=Max(TOTAL Year), Sum(X)) and uncheck to show as bar and show only as popup. In this expression check the option to show the trend line.

rubenmarin_0-1604740502068.png

 

View solution in original post

2 Replies
rubenmarin
MVP
MVP

Hi @YoussefBelloum, I'm not sure if this can work, I did a dumb sample and seems to work.

Add another expression as If(Year=Max(TOTAL Year), Sum(X)) and uncheck to show as bar and show only as popup. In this expression check the option to show the trend line.

rubenmarin_0-1604740502068.png

 

YoussefBelloum
Champion
Champion
Author

Hi @rubenmarin 

Thank you so much for your time !

You solved my problem.

Have a nice day.

 

Youssef