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: 
edwi0012
Contributor III
Contributor III

Creating a trendline.

Hi community!

I've been trying to create a trend line for my OEE data (Or any data actually) and I can't figure it out. In the bottom I've posted a image of how the data look like and how I've aggregated it. I've gotten the example to work, described at their website: 
https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/Statistic...

But for my data that is a bit more complicated I can't figure out if I should do the calculations in the load script or front-end. I've found and tried to follow this thread about this subject. 
https://community.qlik.com/t5/New-to-Qlik-Sense/How-to-calculate-Linear-Trend/td-p/84330

If I use there calculation it would look something like this: 
linest_m(total aggr(if(sum(OEE),sum(OEE)), [Year-Week]), [Year-Week])

That should give me the slope of the line but it won't even give me a number, just a null value "-". Same for linest_b so I didn't post the whole equation y=mx+b here. 

What I would actually want to do, which doesn't work either, is this:
linest_m( aggr(avg(OEE), [Year-Week]), [Year-Week])

Any suggestion? Help are much appreciated!

Example dataExample data

 

Best Regards 
Edvard

Labels (3)
2 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Edvard,

Can you share an example QVF?

Jordy

Climber

Work smarter, not harder
edwi0012
Contributor III
Contributor III
Author

attached a QVF file now. Had to restrict the data a bit for confidential purposes.