Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Trend Linear expression

Hello all,

I have a chart with 3 expressions of last year, actual year and actual month.

How could I add a Trend linear line?

I'm not using dimension in this chart.

Tks!

10 Replies
ogautier62
Specialist II
Specialist II

Hi

what sort of line ?

horizontal ?

trend ?

regards

Anonymous
Not applicable
Author

trend

ogautier62
Specialist II
Specialist II

and how is it calculated ?

average ?

linear regression ?

Anonymous
Not applicable
Author

Linear. LIke this:

This is the expression:

1-(SUM({1<MACHINE_TYPE={'HV'},YEAR_21_20={'$(vLast_year_2120)'}>}MEC_HR_REAL_VER)/

SUM({1<MACHINE_TYPE={'HV'},YEAR_21_20={'$(vLast_year_2120)'}>}PLAN_HR_REAL_VER))

ogautier62
Specialist II
Specialist II

in expression, check this to draw line :

you get coefficient with function linest_m and linest_b

Anonymous
Not applicable
Author

It's already checked for the 3 expression but doesn't show the line.

ogautier62
Specialist II
Specialist II

you must have a dimension,

if not, you have to calculate manually with linest_ and the three expressions

Anonymous
Not applicable
Author

Ok. linest as an expression or reference line?

Do you have any example of how to use linest in this situation?

ogautier62
Specialist II
Specialist II

with Monthyear in dimension,

and just one expression :

1-(SUM({1<MACHINE_TYPE={'HV'}}>}MEC_HR_REAL_VER)/

SUM({1<MACHINE_TYPE={'HV'}}>}PLAN_HR_REAL_VER))

it should work