<?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 Rolling 12 Months in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-12-Months/m-p/515255#M1130539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe that I have gone through all of the rolling 12 month discussions, but none of the solutions seemed to work with the large and complex application that I inherited.&amp;nbsp; I believe that I have another option that I would like to pose to the Qlik Community for feedback.&amp;nbsp; It seems to work, but I'm wondering if there are any flaws in my logic, or possible shortfalls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started by adding the following line to my load script (my script already included a variable for today's date) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Num((Num(Date(MonthStart($(vToday)))) - Num(Date(MonthStart(Date,0)))) / 30), '#,##0') as [Month Counter]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After reloading my application, I added a formula that makes use of set analysis.&amp;nbsp; The formula looks something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;[Month Counter]={'&amp;gt;$(=min([Month Counter])-1)&amp;lt;$(=min([Month Counter])+12'}&amp;gt;} DISTINCT Patients.unique_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, this combination of script and set analysis seems to work, but I seem to have some data issues.&amp;nbsp; When I run a query directly against the SQL source table, my counts are slightly different.&amp;nbsp; I'm wondering if my setup for the "month counter" could be to blame.&amp;nbsp; Any feedback or insights would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Nov 2013 22:30:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-11-12T22:30:10Z</dc:date>
    <item>
      <title>Rolling 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-12-Months/m-p/515255#M1130539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe that I have gone through all of the rolling 12 month discussions, but none of the solutions seemed to work with the large and complex application that I inherited.&amp;nbsp; I believe that I have another option that I would like to pose to the Qlik Community for feedback.&amp;nbsp; It seems to work, but I'm wondering if there are any flaws in my logic, or possible shortfalls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started by adding the following line to my load script (my script already included a variable for today's date) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Num((Num(Date(MonthStart($(vToday)))) - Num(Date(MonthStart(Date,0)))) / 30), '#,##0') as [Month Counter]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After reloading my application, I added a formula that makes use of set analysis.&amp;nbsp; The formula looks something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;[Month Counter]={'&amp;gt;$(=min([Month Counter])-1)&amp;lt;$(=min([Month Counter])+12'}&amp;gt;} DISTINCT Patients.unique_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, this combination of script and set analysis seems to work, but I seem to have some data issues.&amp;nbsp; When I run a query directly against the SQL source table, my counts are slightly different.&amp;nbsp; I'm wondering if my setup for the "month counter" could be to blame.&amp;nbsp; Any feedback or insights would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 22:30:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-12-Months/m-p/515255#M1130539</guid>
      <dc:creator />
      <dc:date>2013-11-12T22:30:10Z</dc:date>
    </item>
  </channel>
</rss>

