<?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 Previous12 and Rolling12 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous12-and-Rolling12/m-p/60376#M10030</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;Hi ,&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;I have posted a query w.r.t this topic already, but still unable to differentiate between these 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;Ex Scenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;I have data for 2015,2016,2017 (Jan till Dec for all years).&amp;nbsp; i need to compare in a bar chart the Rolling12 months sales to Previous12months sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;For rolling12 months i used the below in expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;&lt;STRONG style="font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: bold; border-color: #3d3d3d; border-style: none;"&gt;=Sum({&amp;lt;Date={"$(='&amp;gt;=' &amp;amp; Date(MonthStart(Max(Date), -13)) &amp;amp; '&amp;lt;' &amp;amp; Date(MonthStart(Max(Date))))"}&amp;gt;} Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;&lt;STRONG style="font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: bold; border-color: #3d3d3d; border-style: none;"&gt;or &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;PeriodID = {"&amp;gt;=$(=Max(PeriodID)-11)&amp;lt;=$(=Max(PeriodID))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt; This is resulting in Rolling 12 months. Like 2017 Jan Till Dec sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;If i want to calculate the previous12 months will it be like : present month April 2018 back 12 months which is May 2017 Till April 2018, is my assumption correct or not?&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;Can any one please suggest a code to calculate previous12months, i worked out with almost all links provided in community, i can see Rolling12months but not Previous12months.&amp;nbsp; &lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;Can i get a response on my scenario please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2018 09:22:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-04-05T09:22:21Z</dc:date>
    <item>
      <title>Previous12 and Rolling12</title>
      <link>https://community.qlik.com/t5/QlikView/Previous12-and-Rolling12/m-p/60376#M10030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;Hi ,&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;I have posted a query w.r.t this topic already, but still unable to differentiate between these 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;Ex Scenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;I have data for 2015,2016,2017 (Jan till Dec for all years).&amp;nbsp; i need to compare in a bar chart the Rolling12 months sales to Previous12months sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;For rolling12 months i used the below in expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;&lt;STRONG style="font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: bold; border-color: #3d3d3d; border-style: none;"&gt;=Sum({&amp;lt;Date={"$(='&amp;gt;=' &amp;amp; Date(MonthStart(Max(Date), -13)) &amp;amp; '&amp;lt;' &amp;amp; Date(MonthStart(Max(Date))))"}&amp;gt;} Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;&lt;STRONG style="font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: bold; border-color: #3d3d3d; border-style: none;"&gt;or &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;PeriodID = {"&amp;gt;=$(=Max(PeriodID)-11)&amp;lt;=$(=Max(PeriodID))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt; This is resulting in Rolling 12 months. Like 2017 Jan Till Dec sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;If i want to calculate the previous12 months will it be like : present month April 2018 back 12 months which is May 2017 Till April 2018, is my assumption correct or not?&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;Can any one please suggest a code to calculate previous12months, i worked out with almost all links provided in community, i can see Rolling12months but not Previous12months.&amp;nbsp; &lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: &amp;amp;font-size:13px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px; border-color: #3d3d3d; border-style: none;"&gt;Can i get a response on my scenario please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 09:22:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous12-and-Rolling12/m-p/60376#M10030</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-05T09:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Previous12 and Rolling12</title>
      <link>https://community.qlik.com/t5/QlikView/Previous12-and-Rolling12/m-p/60377#M10031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Considering you have Master Calendar and YearMonth (I am assuming OrderYearMonth) field available..&lt;/P&gt;&lt;P&gt;You first have to do something like below in script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1522920962752294 jive_text_macro" jivemacro_uid="_1522920962752294"&gt;
&lt;P&gt;Period:&lt;/P&gt;
&lt;P&gt;Load &lt;/P&gt;
&lt;P&gt;Date(FieldValue('OrderYearMonth',RecNo()),'YYYYMM') as OrderYearMonth&lt;/P&gt;
&lt;P&gt;AutoGenerate FieldValueCount('OrderYearMonth');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;AsOfPeriodTable:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;OrderYearMonth as AsOfPeriod&lt;/P&gt;
&lt;P&gt;,'Rolling 12' as PeriodType&lt;/P&gt;
&lt;P&gt;,Date(AddMonths(OrderYearMonth,1-IterNo()),'YYYYMM') as OrderYearMonth&lt;/P&gt;
&lt;P&gt;Resident Period&lt;/P&gt;
&lt;P&gt;While IterNo() &amp;lt;= 12;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Period;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now at front end, use below&lt;/P&gt;&lt;P&gt;Dimension&lt;/P&gt;&lt;P&gt;AsOfPeriod&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Experession&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;AsOfPeriod = {"&amp;gt;=$(=Date(AddMonths(Max(AsOfPeriod),-11),'YYYYMM'))&amp;lt;=$(=Max(AsOfPeriod))"}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you Total Sales for Last 12 Months..&lt;/P&gt;&lt;P&gt;Each month will be representing TotalSales of Rolling 12 Months.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 09:37:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous12-and-Rolling12/m-p/60377#M10031</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2018-04-05T09:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Previous12 and Rolling12</title>
      <link>https://community.qlik.com/t5/QlikView/Previous12-and-Rolling12/m-p/1930834#M1218964</link>
      <description>&lt;P&gt;Hi Manish,&lt;/P&gt;
&lt;P&gt;This is will give you rolling 12 months sale , any thought&amp;nbsp; if&amp;nbsp; I want to calculate previous 12 rolling months ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 07:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous12-and-Rolling12/m-p/1930834#M1218964</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2022-05-16T07:06:19Z</dc:date>
    </item>
  </channel>
</rss>

