<?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: Moving Annual Total Scripting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002799#M340795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your input.&amp;nbsp; I am a Newbie to QlikView and i am not sure how to implement your recommendation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 18 Oct 2015 16:10:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-18T16:10:15Z</dc:date>
    <item>
      <title>Moving Annual Total Scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002797#M340793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable vSetRolling12 which calculates rolling 12 months or Moving Annual Total (MAT) based on user date selections and this has the rolling expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PeriodID = {"&amp;gt;=$(=Max(PeriodID) - 11)&amp;lt;=$(=Max(PeriodID))"},&lt;/P&gt;&lt;P&gt;Year = ,&lt;/P&gt;&lt;P&gt;Quarter = ,&lt;/P&gt;&lt;P&gt;Period = ,&lt;/P&gt;&lt;P&gt;Month =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then use the variable to calculate a sum in my Qlikview document as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; =Sum ({$&amp;lt;$(vSetRolling12)&amp;gt;} [MedAid Amount] + [Shortfall]) &lt;/P&gt;&lt;P&gt;which gives the following chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screen Shot 2015-10-18 at 13.02.30.png" class="jive-image image-1" src="/legacyfs/online/102304_Screen Shot 2015-10-18 at 13.02.30.png" style="height: 289px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;So user can select a month and year to give the applicable values for the moving annual total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i now need to convert this to a static MAT so that i can have a chart for say Dec-2013 MAT and Dec-2014 MAT.&amp;nbsp; i have adjusted my expression as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum ({$&amp;lt;$(vSetRolling12), [MonthYear] = {'Dec-2014'}&amp;gt;} [MedAid Amount] + [Shortfall])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above gives the following results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screen Shot 2015-10-18 at 13.22.46.png" class="jive-image image-2" src="/legacyfs/online/102347_Screen Shot 2015-10-18 at 13.22.46.png" style="height: 288px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;The results above are erroneous as this is not a MAT but a value for one month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where am i getting it wrong and how can this be rectified?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Oct 2015 11:40:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002797#M340793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-18T11:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Annual Total Scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002798#M340794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;[MonthYear] = {'Dec-2014'} &lt;/EM&gt;&lt;/SPAN&gt;in your Set Analysis is selecting only that month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to do it so that it is &amp;gt;= the oldest date you want and &amp;lt;= the latest date you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Oct 2015 11:57:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002798#M340794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-18T11:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Annual Total Scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002799#M340795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your input.&amp;nbsp; I am a Newbie to QlikView and i am not sure how to implement your recommendation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Oct 2015 16:10:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002799#M340795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-18T16:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Annual Total Scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002800#M340796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think i now have an idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I have used the following general expression to test my expressions:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Num&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;((&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;({&amp;lt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;DateDispensed&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; = {'&amp;gt;=$(=AddMonths('2015-09-30', -12))&amp;lt;=$(=Date('2015-08-31'))'} &amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;[MedAid Amount]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; + &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;[Shortfall]&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;)), '$##,##0.00') &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;which gives the result below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/2-892816-102361/Screen Shot 2015-10-19 at 04.54.46.png" style="font-style: inherit; font-family: inherit; color: #3778c7;"&gt;&lt;IMG alt="Screen Shot 2015-10-19 at 04.54.46.png" class="jive-image image-2" height="70" src="/legacyfs/online/102365_Screen Shot 2015-10-19 at 04.54.46.png" style="border: 0px; font-style: inherit; font-family: inherit;" width="203" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;To check whether this is correct i used the following set analysis:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Num((Sum ({$&amp;lt;$(vSetRolling12)&amp;gt;}&amp;nbsp; [MedAid Amount] + [Shortfall])), '$##,##0.00')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where vSetRolling12 variable is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;PeriodID = {"&amp;gt;=$(=Max(PeriodID) - 11)&amp;lt;=$(=Max(PeriodID))"},&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Year = ,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Quarter = ,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Period = ,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Month =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;which gives the following result when i select '2015' as the year and 'Aug' as the month from my calendar:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/2-892816-102360/Screen Shot 2015-10-19 at 04.54.35.png" style="font-style: inherit; font-family: inherit; color: #3778c7;"&gt;&lt;IMG alt="Screen Shot 2015-10-19 at 04.54.35.png" class="jive-image image-1" height="72" src="/legacyfs/online/102366_Screen Shot 2015-10-19 at 04.54.35.png" style="border: 0px; font-style: inherit; font-family: inherit;" width="200" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The results are different, what could be the cause for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanking you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 03:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002800#M340796</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-19T03:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Annual Total Scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002801#M340797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have come across a solution, in order to provide a good moving annual total (MAT) analysis. The solution is called As-Of table. A very good example is provided here by Henric Conström:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4531"&gt;The As-Of Table&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, by using DateDiff (difference between the two dates), you might create different flags for flagging current 3months, 6months, 1Year, Ytd, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Oktay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2018 11:48:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Moving-Annual-Total-Scripting/m-p/1002801#M340797</guid>
      <dc:creator>itec_pao</dc:creator>
      <dc:date>2018-04-09T11:48:58Z</dc:date>
    </item>
  </channel>
</rss>

