Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
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 

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

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.