<?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: LINEST_M AGGR() not performing as expected in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/LINEST-M-AGGR-not-performing-as-expected/m-p/2509112#M104658</link>
    <description>&lt;P&gt;Thank&amp;nbsp; you for the assist&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6152"&gt;@Oleg_Troyansky&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
    <pubDate>Mon, 10 Mar 2025 17:19:41 GMT</pubDate>
    <dc:creator>SDT</dc:creator>
    <dc:date>2025-03-10T17:19:41Z</dc:date>
    <item>
      <title>LINEST_M AGGR() not performing as expected</title>
      <link>https://community.qlik.com/t5/App-Development/LINEST-M-AGGR-not-performing-as-expected/m-p/2508644#M104558</link>
      <description>&lt;P&gt;Fairly certain this is user error (mine) so hoping for some assistance. I am using the expression below to obtain the trend of revenue over time.&lt;/P&gt;
&lt;P&gt;The set analysis is to exclude the current (incomplete) month from the dataset and allow the user to choose a range of other months in the line chart. I added a linear trend line on the chart and in several cases the slope shown for a given product market in the table is the opposite direction of the trend line.&lt;/P&gt;
&lt;P&gt;{&amp;lt;[Date.autoCalendar.MonthsAgo]={"&amp;gt;0"}&amp;gt;}&lt;BR /&gt;LinEst_M(AGGR(SUM(Revenue),[Date.autoCalendar.YearMonth],ProductMarket),[Date.autoCalendar.YearMonth])&lt;/P&gt;
&lt;P&gt;The table contains the ProductMarket and the expression above.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 16:05:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/LINEST-M-AGGR-not-performing-as-expected/m-p/2508644#M104558</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2025-03-06T16:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: LINEST_M AGGR() not performing as expected</title>
      <link>https://community.qlik.com/t5/App-Development/LINEST-M-AGGR-not-performing-as-expected/m-p/2508663#M104566</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'd suspect that the derived field&amp;nbsp;&lt;SPAN&gt;[Date.autoCalendar.YearMonth] might be the reason for the problem. Since this derived calendar is generated automatically, we can never be sure how these fields are sorted when the data is being loaded. I recommend trying one of the following:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. Try adding the sort order to your AGGR dimensions. Something along these lines:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&amp;lt;[Date.autoCalendar.MonthsAgo]={"&amp;gt;0"}&amp;gt;}&lt;BR /&gt;LinEst_M(&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;AGGR(SUM(Revenue),&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ([Date.autoCalendar.YearMonth], NUMERIC, ASC)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,ProductMarket)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;,[Date.autoCalendar.YearMonth])&lt;BR /&gt;&lt;BR /&gt;2. If that didn't solve the problem, try generating a proper data field YearMonth and then use that in your AGGR, also sorted in numerical order:&lt;BR /&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;...&lt;BR /&gt;Date,&lt;BR /&gt;Date(MonthStart(Date), 'MMM-YYYY')&amp;nbsp; &amp;nbsp;as YearMonth,&lt;BR /&gt;...&lt;BR /&gt;-------------&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&amp;lt;[Date.autoCalendar.MonthsAgo]={"&amp;gt;0"}&amp;gt;}&lt;BR /&gt;LinEst_M(&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;AGGR(SUM(Revenue),&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (YearMonth, NUMERIC, ASC)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,ProductMarket)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;,YearMonth)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope that one of these two solutions solve the problem.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 17:39:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/LINEST-M-AGGR-not-performing-as-expected/m-p/2508663#M104566</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2025-03-06T17:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: LINEST_M AGGR() not performing as expected</title>
      <link>https://community.qlik.com/t5/App-Development/LINEST-M-AGGR-not-performing-as-expected/m-p/2509112#M104658</link>
      <description>&lt;P&gt;Thank&amp;nbsp; you for the assist&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6152"&gt;@Oleg_Troyansky&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 17:19:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/LINEST-M-AGGR-not-performing-as-expected/m-p/2509112#M104658</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2025-03-10T17:19:41Z</dc:date>
    </item>
  </channel>
</rss>

