<?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: Rolling 12 months in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312932#M115515</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you do some changes in your Count statement like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;YearMonth ={"&amp;gt;=$(=Date(addmonths(Max(YearMonth), -12), 'MMM-YY'))&amp;nbsp;&amp;nbsp; &amp;lt;=$(=Date(addmonths(Max(YearMonth), -1),&amp;nbsp; 'MMM-YY'))"} &amp;gt;} SampleNo)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by this you get rolling 12 months &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attched sample&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Aug 2011 10:45:09 GMT</pubDate>
    <dc:creator>its_anandrjs</dc:creator>
    <dc:date>2011-08-31T10:45:09Z</dc:date>
    <item>
      <title>Rolling 12 months</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312931#M115514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get a chart to stay locked to last 12 months even if user trys to change dates.&lt;/P&gt;&lt;P&gt;The table itsefl only consists of reporing date and sample number.&lt;/P&gt;&lt;P&gt;So in short I need to graphs one that allways shows the last rolling 12 months of count, and one the shows the last 12 months based on user selection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my load I have:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(AddMonths("Reporting Date",0)) &amp;amp; Num(Month(AddMonths("Reporting Date",0)),00) as Period, // gets perod like YYYYMM from reporting date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(AddMonths(today(),-13)) &amp;amp; Num(Month(AddMonths(today(),-13)),00) as Startdate, // sets a startdate to 13 months back from today YYYYMM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(AddMonths(today(),0)) &amp;amp; Num(Month(AddMonths(today(),0)),00) as Enddate, // sets enddate to todays month YYYYMM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(Month(AddMonths(Bed.Dato,0)),00) as Month2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Year(AddMonths(Bed.Dato,0)),00) as Year2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Reporting Date", // datetime from table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SampleNo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My expression looks for the rolling last 12 months&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;[Reporting date]=,Period={"&amp;gt;$(Min(Startdate))&amp;lt;$(=Min(Enddate))"}&amp;gt;} SampleNo)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How ot solve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 10:37:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312931#M115514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-31T10:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 12 months</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312932#M115515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you do some changes in your Count statement like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;YearMonth ={"&amp;gt;=$(=Date(addmonths(Max(YearMonth), -12), 'MMM-YY'))&amp;nbsp;&amp;nbsp; &amp;lt;=$(=Date(addmonths(Max(YearMonth), -1),&amp;nbsp; 'MMM-YY'))"} &amp;gt;} SampleNo)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by this you get rolling 12 months &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attched sample&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 10:45:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312932#M115515</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2011-08-31T10:45:09Z</dc:date>
    </item>
    <item>
      <title>Rolling 12 months</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312933#M115516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think there is an equal sign missing before Min(StartDate), then I would also clear Month2 and Year2, so try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;[Reporting date]=,Year2=, Month2=,Period={"&amp;gt;$(=Min(Startdate))&amp;lt;$(=Min(Enddate))"}&amp;gt;} SampleNo)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since Startdate and enddate are based on today() only, you could use variables instead of fields for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't checked thorougly your expressions in the script, I assume the format of Period and StartDate and Enddate is consistent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 10:48:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312933#M115516</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-31T10:48:09Z</dc:date>
    </item>
    <item>
      <title>Rolling 12 months</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312934#M115517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swuehl, Your code worked like a charm. Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anand: I tired your code but I got some error. will try it out when I get this app up running&amp;nbsp; Thanks for your insight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 10:54:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-months/m-p/312934#M115517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-31T10:54:49Z</dc:date>
    </item>
  </channel>
</rss>

