<?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: Accumulating distinct values by week in a barchart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736471#M263476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps you can get the needed result with an AsOf table where every week is associated with itself and all its previous weeks. That way you should be able to get the accumulated &lt;EM&gt;distinct&lt;/EM&gt; count. See this document for more information: &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-4252" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3778c7;"&gt;Calculating rolling n-period totals, averages or other aggregations&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Oct 2014 13:31:23 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2014-10-01T13:31:23Z</dc:date>
    <item>
      <title>Accumulating distinct values by week in a barchart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736470#M263475</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 need to create a bar chart that counts distinct customers by week cumulatvley.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the expression I have used at present (which works ok when i plot each week individually&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Year]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vMaxYear)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Customer&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;If I select full accumulation it sums the totals from each week but doesn't remove duplicates in the customer number.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;I think i probably need to use a rangesum but i'm not sure how to write this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 12:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736470#M263475</guid>
      <dc:creator />
      <dc:date>2014-10-01T12:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulating distinct values by week in a barchart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736471#M263476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps you can get the needed result with an AsOf table where every week is associated with itself and all its previous weeks. That way you should be able to get the accumulated &lt;EM&gt;distinct&lt;/EM&gt; count. See this document for more information: &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-4252" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3778c7;"&gt;Calculating rolling n-period totals, averages or other aggregations&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 13:31:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736471#M263476</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-10-01T13:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulating distinct values by week in a barchart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736472#M263477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this, I've tried to add this to my script but it fails to load.&lt;/P&gt;&lt;P&gt;I have over&amp;nbsp; 1,400,000 transactions to calculate against.- woudl this be causing the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AsOfWeek:&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;FWeek as FWeek_AsOf,&lt;/P&gt;&lt;P&gt;FWeek + 1 - IterNo() as FWeek&lt;/P&gt;&lt;P&gt;Resident DEMAND&lt;/P&gt;&lt;P&gt;while IterNo() &amp;lt;= 52;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;right join load FWeek Resident DEMAND; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AsOfWeek:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load 'Current' as Type,&lt;/P&gt;&lt;P&gt;FWeek as FWeek_AsOf,&lt;/P&gt;&lt;P&gt;FWeek as FWeek&lt;/P&gt;&lt;P&gt;Resident DEMAND;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate (AsOfWeek)&lt;/P&gt;&lt;P&gt;load 'Rolling 52' as Type,&lt;/P&gt;&lt;P&gt;FWeek as FWeek_AsOf,&lt;/P&gt;&lt;P&gt;FWeek + 1 - IterNo() as FWeek&lt;/P&gt;&lt;P&gt;Resident DEMAND&lt;/P&gt;&lt;P&gt;while IterNo() &amp;lt;= 52;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;right join load FWeek Resident DEMAND;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 13:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736472#M263477</guid>
      <dc:creator />
      <dc:date>2014-10-02T13:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulating distinct values by week in a barchart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736473#M263478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two things spring to mind:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You probably want to use a load distinct when creating the AsOfWeek table to get the distinct weeks from the DEMAND table. That way you don't start with an AsOfWeeks table with 1,400,000 records.&lt;/LI&gt;&lt;LI&gt;Right joining the AsOfWeek table with the fact table isn't a good idea since it will explode your fact table.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 13:51:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulating-distinct-values-by-week-in-a-barchart/m-p/736473#M263478</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-10-02T13:51:13Z</dc:date>
    </item>
  </channel>
</rss>

