<?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 Trend off last 6 month on a KPI in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Trend-off-last-6-month-on-a-KPI/m-p/1549922#M39626</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i want to a trend off the last 6 month on a KPI, like up or down.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have use le function&amp;nbsp;linest_m, but ir doesn't work like i want (in this exemple i have use last 2 month to test) :&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;linest_m(total aggr(if(Sum( {&amp;lt;FACT_Type = {'PO'},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DateAnalyse={"&amp;lt;=$(=Date(Max({&amp;lt;FACT_Type={"PO"}&amp;gt;} DateAnalyse)))"}*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"&amp;gt;=$(=addmonths(Date(Max({&amp;lt;FACT_Type={"PO"}&amp;gt;} DateAnalyse)),-1))"}&amp;gt;} [_Quantite_commandee])*only({1}Period_MonthYear),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Sum( {&amp;lt;FACT_Type = {'PO'},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DateAnalyse={"&amp;lt;=$(=Date(Max({&amp;lt;FACT_Type={"PO"}&amp;gt;} DateAnalyse)))"}*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"&amp;gt;=$(=addmonths(Date(Max({&amp;lt;FACT_Type={"PO"}&amp;gt;} DateAnalyse)),-1))"}&amp;gt;} [_Quantite_commandee])*only({1}Period_MonthYear)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;),Period_MonthYear),Period_MonthYear)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sophie&lt;/P&gt;</description>
    <pubDate>Wed, 27 Feb 2019 14:34:08 GMT</pubDate>
    <dc:creator>sophie_bd</dc:creator>
    <dc:date>2019-02-27T14:34:08Z</dc:date>
    <item>
      <title>Trend off last 6 month on a KPI</title>
      <link>https://community.qlik.com/t5/App-Development/Trend-off-last-6-month-on-a-KPI/m-p/1549922#M39626</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i want to a trend off the last 6 month on a KPI, like up or down.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have use le function&amp;nbsp;linest_m, but ir doesn't work like i want (in this exemple i have use last 2 month to test) :&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;linest_m(total aggr(if(Sum( {&amp;lt;FACT_Type = {'PO'},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DateAnalyse={"&amp;lt;=$(=Date(Max({&amp;lt;FACT_Type={"PO"}&amp;gt;} DateAnalyse)))"}*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"&amp;gt;=$(=addmonths(Date(Max({&amp;lt;FACT_Type={"PO"}&amp;gt;} DateAnalyse)),-1))"}&amp;gt;} [_Quantite_commandee])*only({1}Period_MonthYear),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Sum( {&amp;lt;FACT_Type = {'PO'},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DateAnalyse={"&amp;lt;=$(=Date(Max({&amp;lt;FACT_Type={"PO"}&amp;gt;} DateAnalyse)))"}*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"&amp;gt;=$(=addmonths(Date(Max({&amp;lt;FACT_Type={"PO"}&amp;gt;} DateAnalyse)),-1))"}&amp;gt;} [_Quantite_commandee])*only({1}Period_MonthYear)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;),Period_MonthYear),Period_MonthYear)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sophie&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 14:34:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trend-off-last-6-month-on-a-KPI/m-p/1549922#M39626</guid>
      <dc:creator>sophie_bd</dc:creator>
      <dc:date>2019-02-27T14:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trend off last 6 month on a KPI</title>
      <link>https://community.qlik.com/t5/App-Development/Trend-off-last-6-month-on-a-KPI/m-p/1550080#M39641</link>
      <description>I'd first check if your expression is working accordingly to fit it to the linest_m function.&lt;BR /&gt;Use it in a chart to see if you're not getting set analysis errors.&lt;BR /&gt;&lt;BR /&gt;Felipe.</description>
      <pubDate>Wed, 27 Feb 2019 19:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trend-off-last-6-month-on-a-KPI/m-p/1550080#M39641</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2019-02-27T19:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trend off last 6 month on a KPI</title>
      <link>https://community.qlik.com/t5/App-Development/Trend-off-last-6-month-on-a-KPI/m-p/1550878#M39708</link>
      <description>&lt;P&gt;Hello Sophie.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this exp in my qvs file. It calculates a 'rolling month' trend based on the period the user selects. The variable is called&amp;nbsp;v_Roll_Period and I defined a few values to it, 13, 18, 24, 30 and 36. You can also replace the var with a value if you want to. You will have to modify it to suite your needs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;LET e_Rolling_Amount = Replace(Replace('&lt;BR /&gt;sum({&amp;lt;tx_Summary={|FUEL|}, [Transaction Base Month]={"&amp;lt;=%(=Year(max([Transaction Date]))*12 + Month(max([Transaction Date])))&amp;gt;=%(=Year(max([Transaction Date]))*12 + Month(max([Transaction Date]))-(%(v_Roll_Period)-1))"}&amp;gt;}Amount)&lt;BR /&gt;', '|', Chr(39)), '%', '$');&lt;/P&gt;&lt;P&gt;Remember the sorting in the object itself:&lt;/P&gt;&lt;P&gt;max({1&amp;lt;[Transaction Base Month]={"&amp;lt;=$(=Year(max([Transaction Date]))*12 + Month(max([Transaction Date])))&amp;gt;=$(=Year(max([Transaction Date]))*12 + Month(max([Transaction Date]))-($(v_Roll_Period)-1))"}&amp;gt;}[Transaction Base Month])&lt;/P&gt;&lt;P&gt;In my calendar I have a field [Transaction Base Month] which is :&amp;nbsp;Year(Date)*12 + Month(Date) as [Transaction Base Month].&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should end up with something like this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example.JPG" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/7039iB4587330E3A9F544/image-size/medium?v=v2&amp;amp;px=400" role="button" title="example.JPG" alt="example.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 04:42:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trend-off-last-6-month-on-a-KPI/m-p/1550878#M39708</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2019-03-01T04:42:49Z</dc:date>
    </item>
  </channel>
</rss>

