Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
Showing results for 
Search instead for 
Did you mean: 
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: 

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. 

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 

2 Replies

Hi Edvard,

Can you share an example QVF?



Work smarter, not harder
Contributor III
Contributor III

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