Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

Problems with adding a trendline in line graph

Hello,

I am having problems with calculating a trendline in a line graph, using the linest_m and linest_b functions.

Here is my expression:

//-----------------------------------

LINEST_B(
total aggr(sum(numDistanceSteamingTotal) / sum(numTimeSteamingTotal),dtmPeriodStart),
    aggr(RowNo(),dtmPeriodStart)
)

+

LINEST_M(
total aggr(sum(numDistanceSteamingTotal) / sum(numTimeSteamingTotal),dtmPeriodStart),
    aggr(RowNo(),dtmPeriodStart)


RowNo()

//-----------------------------------

I get back a result - a straight line, but it is obviously not the correct closest fit to my other expression. See attached picture. linest example.png

Any help in finding a solution to this would be greatly appreciated!

Best Regards,

Niclas