<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Matching linest_m and linest_b function to auto-generated trendline in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312712#M585159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this was some time ago but I've used your example and it looks great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a slight problem with calculating N, there any light you can shed on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I don't suppose you've done the same with manual calculating Intercept? Having some troubles with the difference between linest_m and linest_b when compared to their equivalents in Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate any help you can give on this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jun 2015 12:25:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-06-25T12:25:26Z</dc:date>
    <item>
      <title>Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312707#M585154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a set of date with [Date] on the x-axis and [Score] on the y-axis.&amp;nbsp; When I plot the data as a bar chart and add a linear trendline I get the following auto-generated line equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;y = 0.25368x + 81.368&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to pull the slope (m) and y-intercept (b) out of that equation so I can use it in a straight table.&amp;nbsp; Following the documentation and the many posts on this forum regarding this subject I added the following expressions to a straight table.&amp;nbsp; This straight table has a single dimension - [Date].&lt;/P&gt;&lt;P&gt;linest_m(Total Aggr(Sum(Score), Date), Date)&lt;/P&gt;&lt;P&gt;linest_b(Total Aggr(Sum(Score), Date), Date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What comes out for each [Date] row is m = 0.044559106 and b = -1729.108.&amp;nbsp; This is vastly different from the m and b values given in the auto-generated linear trendline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is why?&amp;nbsp; I created a dummy QV application to match the example shown in the QV9 "Nested Aggregations and Related Issues" online help (which can be accessed via a link in the online help for the Aggr() function) and I was able to get the trendline, linest_m() and linest_b() functions to behave properly.&amp;nbsp; Is there an issue with using dates as the x-axis for these regression calculations?&amp;nbsp; I assume that QV is somehow converting these dates into values - for the y=0.25368x + 81.368 equation the line plots properly if I use x-values of 1,2,3,etc.&amp;nbsp; I'm not sure what is being used for x when I try to use linest_m and linest_b, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wondering if anyone has run into this before or if there is any insight.&amp;nbsp; Unfortunately I cannot share my application as it contains protected health information.&amp;nbsp; I have created a dummy application where I can duplicate this problem which I can upload if anyone would like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 02:41:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312707#M585154</guid>
      <dc:creator />
      <dc:date>2011-08-31T02:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312708#M585155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a test application that shows what I'm seeing.&amp;nbsp; I can confirm that when QlikView adds the trendline it is changing the dates on my x-axis to the values 0, 1, 2, etc.&amp;nbsp; When I use the linest_m() and linest_b() functions QlikView is using the actual numerical value of the dates instead (40634, 40603, 40575, etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of the day the results from y=mx+b are pretty close.&amp;nbsp; They aren't exactly the same, but close enough.&amp;nbsp; I guess I'd just rather be able to reproduce the QlikView-generated trendline because it has a nicer y-intercept.&amp;nbsp; You'll see in the app that their line crosses at y = 733.5 and my derived line crosses at 160,034.1715.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone had thoughts on how to dynamically convert my date dimension into a value of 0, 1, 2, etc. for use in the linest_m() and linest_b() equations that would be good to know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 16:20:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312708#M585155</guid>
      <dc:creator />
      <dc:date>2011-08-31T16:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312709#M585156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope I understood your problem correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used &lt;/P&gt;&lt;P&gt;=aggr(rank(-X2),X2)-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as dimension to convert your Daterange into consecutive numbers 0,1,2,3... and adapted your manual calculation accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 20:25:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312709#M585156</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-31T20:25:33Z</dc:date>
    </item>
    <item>
      <title>Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312710#M585157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks!&amp;nbsp; That works very well.&amp;nbsp; I was surprised that I couldn't use this new calculated dimension in the linest_m and linest_b functions but it worked fine with the manual calculation (as you saw).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2011 15:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312710#M585157</guid>
      <dc:creator />
      <dc:date>2011-09-02T15:14:31Z</dc:date>
    </item>
    <item>
      <title>Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312711#M585158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the linest_X functions only take a field as parameter where you need to put the x-Values in, no calculated dimension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2011 15:48:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312711#M585158</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-02T15:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312712#M585159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this was some time ago but I've used your example and it looks great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a slight problem with calculating N, there any light you can shed on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I don't suppose you've done the same with manual calculating Intercept? Having some troubles with the difference between linest_m and linest_b when compared to their equivalents in Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate any help you can give on this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 12:25:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312712#M585159</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-25T12:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312713#M585160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, yes, it has been a while since then...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's your issue with calculation of N?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you upload some data, like a sample QVW and your Excel calculations?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 16:03:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312713#M585160</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-06-25T16:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312714#M585161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply swuehl, sorry took a bit of time putting together the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I've got N now actually, the distinct number of known y's?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached a qvw with the calculations and an excel file with the data and also expected excel values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently getting a positive value when using your manual calculation for slope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 11:19:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312714#M585161</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-26T11:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312715#M585162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some slight modifications to your expressions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 16:00:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312715#M585162</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-06-26T16:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312716#M585163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks swuehl, perfect!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached the latest version where I've added the Intercept calculation too. This now exactly replicates Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers for your help on this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 14:14:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312716#M585163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-30T14:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312717#M585164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having the same problem getting Linest and Excel to match... I'm using the free QV personal edition and therefore can't open your example .qvws... can you post your slope and intercept expression calculations so I can see them? Thanks! &lt;A href="https://community.qlik.com/qlik-users/15823"&gt;swuehl&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 May 2016 22:27:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312717#M585164</guid>
      <dc:creator />
      <dc:date>2016-05-21T22:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312718#M585165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you help me too maybe? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/1252364"&gt;Manual cumulative regression line using Linest_M and Linest_B functions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Linoy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:45:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312718#M585165</guid>
      <dc:creator>linoyel</dc:creator>
      <dc:date>2017-04-18T15:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312719#M585166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@@Hi Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although this post is really old I have found your solution really useful to develop customized trend lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed your steps and i was able to develop m value successfully as the auto generated trend line function.&lt;/P&gt;&lt;P&gt;I am attaching my qvw file .&lt;/P&gt;&lt;P&gt;What i havent understood is that when i use m*X2Value + Y2 to plot the trend line this value doesn't seem to match the graph value. Am i doing something wrong while adding the intercept?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your suggestions will be really helpful as I have been stuck with this for a really long time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 09:26:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312719#M585166</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-05T09:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312720#M585167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to calculate the y intercept as shown in Grahams post (and as I added to your QVW).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 22:40:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312720#M585167</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-06-05T22:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312721#M585168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stefan..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like i got all mixed up with the intercept calculation from Graham's post. Both the solutions's worked. Thanks for the assistance as this was a long stuck issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 04:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312721#M585168</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-06T04:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312722#M585169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just one more question.. Why does it make me select the months for the m value and intercept to be calculated properly? If i dont select the month it displays incorrect values. I replaced Month with Last12Months. Y value is calculated correctly but the m value and intercept shows right values only if the 12 months selected in the listbox..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 06:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312722#M585169</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-06T06:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312723#M585170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's because the advanced aggregations in the Ey and Avg Y calculations do take NULL in its dimension into account:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2017-06-06 11_26_17-QlikView x64 - [E__Users_Stefan_Downloads_Trend lines Linest functions_2.qvw_].png" class="jive-image image-1" src="/legacyfs/online/165887_2017-06-06 11_26_17-QlikView x64 - [E__Users_Stefan_Downloads_Trend lines Linest functions_2.qvw_].png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need to filter on the Last12Months dimension values only:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ey:&lt;/P&gt;&lt;P&gt;=sum(&lt;STRONG&gt;{&amp;lt;Last12Months = {"*"}&amp;gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;total(aggr(count (DISTINCT {&amp;lt;[Referred to CPS]={'Y'},DateType={'Created','Created_RTC','Created_Regulatory_Static_2016'},Revised_Priority = {'1. High','2.1 Medium - Multiple Customer Impact','2.2 Medium - Critical care Customer Impact','1.1 Critical','1.2 Critical','2.1 High','2.2 High','1. Critical','2. High','3.1 Medium - Urgent'}&amp;gt;}[TR #]),Last12Months)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg Y:&lt;/P&gt;&lt;P&gt;=Avg(&lt;STRONG&gt;{&amp;lt;Last12Months = {"*"}&amp;gt;}&lt;/STRONG&gt; TOTAL&lt;/P&gt;&lt;P&gt;Aggr( count( distinct {&amp;lt;[Referred to CPS]={'Y'},DateType={'Created','Created_RTC','Created_Regulatory_Static_2016'},Revised_Priority = {'1. High','2.1 Medium - Multiple Customer Impact','2.2 Medium - Critical care Customer Impact','1.1 Critical','1.2 Critical','2.1 High','2.2 High','1. Critical','2. High','3.1 Medium - Urgent'}&amp;gt;}[TR #]),Last12Months))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 09:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312723#M585170</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-06-06T09:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312724#M585171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stefan once again..made the changes accordingly...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2017 07:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/312724#M585171</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-07T07:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Matching linest_m and linest_b function to auto-generated trendline</title>
      <link>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/1660483#M585172</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My function is working correctly but there are 3 different calendars linked to dimension.&lt;/P&gt;&lt;P&gt;Issue:- When by default a calendar is set and I implement the linest function it shows blanks for the other 2 calendars.&lt;/P&gt;&lt;P&gt;Have attached the graph for your reference.&lt;/P&gt;&lt;P&gt;My question is how do we get the function working on dynamic period(Month, Day, Year), dimension(3 calendars linked(Financial, Standard, CSS).&lt;/P&gt;&lt;P&gt;It should work when I select the different calendars or different period.&lt;/P&gt;&lt;P&gt;Any help is highly appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 12:53:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Matching-linest-m-and-linest-b-function-to-auto-generated/m-p/1660483#M585172</guid>
      <dc:creator>matinmanish</dc:creator>
      <dc:date>2019-12-24T12:53:42Z</dc:date>
    </item>
  </channel>
</rss>

