<?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 Last n Months in Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415121#M427602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a need to calculate the last 6 months (excluding the reported month) Sales for a given reported date in the sample provided. &lt;/P&gt;&lt;P&gt;For instance, Customer 20170 will have the following details once completed in the data model.&lt;/P&gt;&lt;P&gt;11/2017 - $343,913&lt;/P&gt;&lt;P&gt;10/2017 - $343,562&lt;/P&gt;&lt;P&gt;I have tried the concept with a IF...previous and RangeSum with Peek but I cannot do something similar to Above function in Script.&lt;/P&gt;&lt;P&gt;Appreciate your assistance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Dec 2017 04:45:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-12-02T04:45:44Z</dc:date>
    <item>
      <title>Last n Months in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415121#M427602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a need to calculate the last 6 months (excluding the reported month) Sales for a given reported date in the sample provided. &lt;/P&gt;&lt;P&gt;For instance, Customer 20170 will have the following details once completed in the data model.&lt;/P&gt;&lt;P&gt;11/2017 - $343,913&lt;/P&gt;&lt;P&gt;10/2017 - $343,562&lt;/P&gt;&lt;P&gt;I have tried the concept with a IF...previous and RangeSum with Peek but I cannot do something similar to Above function in Script.&lt;/P&gt;&lt;P&gt;Appreciate your assistance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2017 04:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415121#M427602</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-02T04:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Last n Months in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415122#M427603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-9250"&gt;Rolling N months&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2017 09:26:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415122#M427603</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-12-02T09:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Last n Months in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415123#M427604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need As-Of Table, like this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Data:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style=": ; color: #0000ff;"&gt;LOAD&lt;/STRONG&gt; &lt;SPAN style="color: #800000;"&gt;Customer&lt;/SPAN&gt;, &lt;BR /&gt; &lt;SPAN style="color: #800000;"&gt;Amount&lt;/SPAN&gt;, &lt;BR /&gt; &lt;SPAN style="color: #800000;"&gt;WorkDays&lt;/SPAN&gt;, &lt;BR /&gt; &lt;SPAN style="color: #800000;"&gt;ReportedDate&lt;/SPAN&gt;,&lt;SPAN style="color: #0000ff;"&gt;MonthName&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;ReportedDate&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Month&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt;&lt;BR /&gt; SampleDataSet.xls&lt;BR /&gt; (&lt;SPAN style="color: #0000ff;"&gt;biff&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;embedded&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;labels&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;table&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;is&lt;/SPAN&gt; Sheet1$);&lt;BR /&gt; Temp:&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;LOAD&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Month&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Resident&lt;/SPAN&gt; Data;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Join&lt;/SPAN&gt; &lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;LOAD&lt;/STRONG&gt; &lt;SPAN style="color: #800000;"&gt;Month&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AsOfMonth&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Resident&lt;/SPAN&gt; Temp;&lt;BR /&gt; [As-Of Table]:&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;Load&lt;/STRONG&gt; &lt;SPAN style="color: #800000;"&gt;Month&lt;/SPAN&gt;,&lt;BR /&gt; &lt;SPAN style="color: #800000;"&gt;AsOfMonth&lt;/SPAN&gt;,&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Round&lt;/SPAN&gt;((&lt;SPAN style="color: #800000;"&gt;AsOfMonth&lt;/SPAN&gt;-&lt;SPAN style="color: #800000;"&gt;Month&lt;/SPAN&gt;)*12/365.2425) &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;MonthDiff&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Resident&lt;/SPAN&gt; Temp&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Where&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AsOfMonth&lt;/SPAN&gt; &amp;gt;= &lt;SPAN style="color: #800000;"&gt;Month&lt;/SPAN&gt;;&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;Drop&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;Table&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; Temp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/185483_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2017 11:30:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415123#M427604</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2017-12-02T11:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Last n Months in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415124#M427605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌thanks for sharing the conept. the concept will work well I believe in visualisations using objects with set analysis. however what I am after is a method to build this to a fact table that could be used in some other calculations with other data in later steps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2017 20:17:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415124#M427605</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-02T20:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Last n Months in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415125#M427606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MAny thanks for demonstrating the concept. ‌‌this will work well in sheets with visualisation objects using set analysis. however what I am after is a method to build this to a fact table that could be used in some other calculations with other data in later steps. So I would need something that combines both tables to a single table for 6 month total based on prior month to selected month. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2017 20:23:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415125#M427606</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-02T20:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Last n Months in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415126#M427607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have managed to figure out a technique by the use of "Flags".&lt;/P&gt;&lt;P&gt;1. Associate a distinct set of Months with the base data load by left joining a new date field to the base load. 1000 rows of base load with 12 distinct months will become 12,000 rows. (New Field = CalcDate)&lt;/P&gt;&lt;P&gt;2. Use Flag to identify which rows are applicable for calculation. ie.&lt;/P&gt;&lt;P&gt;,IF(ReportedDate &amp;gt; Addmonths(CalcDate,-7) and ReportedDate &amp;lt; CalcDate,1,0) as Flag &lt;/P&gt;&lt;P&gt;Note the load to be in ReportedMonth DESC order.&lt;/P&gt;&lt;P&gt;3. Left Join Base Table with Aggrgated values for each Customer, reporting month where Flag = 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Dec 2017 00:08:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1415126#M427607</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-03T00:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Last n Months in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1708702#M451613</link>
      <description>&lt;P&gt;HI&amp;nbsp; ..&amp;nbsp; good example&lt;/P&gt;&lt;P&gt;&amp;nbsp;same way.. instead of&amp;nbsp; Month&amp;nbsp; &amp;nbsp;i have&amp;nbsp; date field in my dimension.. so..&lt;/P&gt;&lt;P&gt;if i apply same script for date last&amp;nbsp; 3 months sales excluding current month...&amp;nbsp; its not working(its splitting by date wise by default).. could u please suggest me how to do that..&lt;/P&gt;&lt;P&gt;My dimension - Date&lt;/P&gt;&lt;P&gt;Measure 1 --&amp;gt;&amp;nbsp; Sum(Sales)&amp;nbsp; each date wise&lt;/P&gt;&lt;P&gt;Measure(2)--&amp;gt; last 3 month sales --&amp;gt; here excluding&amp;nbsp; current month&amp;nbsp; so it will be common for all respected month&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18624"&gt;@Gysbert_Wassenaar&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622"&gt;@hic&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;@&lt;/SPAN&gt;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/7318" target="_self"&gt;&lt;SPAN class=""&gt;Antoniotiman&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 23:06:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-n-Months-in-Script/m-p/1708702#M451613</guid>
      <dc:creator>kdr_Qv</dc:creator>
      <dc:date>2020-06-05T23:06:45Z</dc:date>
    </item>
  </channel>
</rss>

