<?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: Re: Re: Rolling 3 month count distinct in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663122#M241593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I thought the 3 months was just an example, not the specific requirement. I think your idea to use date islands is absolutely correct in that case. Alternatively, I'm attaching another way to accomplish what you want, but this requires a slight data model change to ensure that each customer is associated to each Period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jun 2014 15:32:50 GMT</pubDate>
    <dc:creator>vgutkovsky</dc:creator>
    <dc:date>2014-06-26T15:32:50Z</dc:date>
    <item>
      <title>Rolling 3 month count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663119#M241590</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 have a problem figuring out how to calculate a rolling total of distinct customers to be used in a chart/table with Period (YYYYMM) as single dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No problem sorting out e.g.:&lt;/P&gt;&lt;P&gt;1. Monthly Sales: sum(Sales)&lt;/P&gt;&lt;P&gt;2. 3M Rolling Monthly sales: sum(aggr(rangesum(above(SUM(Sales),0,3) ),Period))&lt;/P&gt;&lt;P&gt;3. Distinct number of customers per month: count(DISTINCT Name)&lt;/P&gt;&lt;P&gt;4. 3M non-distinct number of customers (which is fairy useless as a KPI): sum( aggr( rangesum( above(COUNT(DISTINCT Name),0,3) ),Period))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See example document for some example data. The idea is to end up with the number 3 for period 201303 rolling 3 month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been able to create a dirty solution with a date island and if-statements, but would hope to have something based on aggr/above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Niklas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 12:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663119#M241590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-26T12:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 3 month count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663120#M241591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression would be something like this, with Full Accumulation enabled on the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Period = min(total &amp;lt;Name&amp;gt; Period),1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Name,Period&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 14:23:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663120#M241591</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-06-26T14:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Rolling 3 month count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663121#M241592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should have been clearer with my request regarding the three month rolling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution solves a possible "since start" distinct queries, which is of course the same for only 3 months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With a longer time frame (now attached) it misses my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I should add that I did a similar if statement with my date island IF(period&amp;lt;=island_period and &amp;gt;island_period-3), but I would hope to avoid if's and date islands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Niklas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 14:46:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663121#M241592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-26T14:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Rolling 3 month count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663122#M241593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I thought the 3 months was just an example, not the specific requirement. I think your idea to use date islands is absolutely correct in that case. Alternatively, I'm attaching another way to accomplish what you want, but this requires a slight data model change to ensure that each customer is associated to each Period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 15:32:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-3-month-count-distinct/m-p/663122#M241593</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-06-26T15:32:50Z</dc:date>
    </item>
  </channel>
</rss>

