0 Replies Latest reply: Feb 9, 2016 4:59 AM by Niclas Grahm RSS

    Problems with adding a trendline in line graph

    Niclas Grahm

      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