<?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: How to sum(qty) within variable time period in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394697#M488838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The forum is having problems at the moment. I received email from the forum that a reply was posted, but no reply appears for the post, and the email link in the notification was invalid.&amp;nbsp; If you post a response and do not see it here, please email it to me at &lt;A href="mailto:richard.tefft@scipax.com"&gt;richard.tefft@scipax.com&lt;/A&gt;.&amp;nbsp; Thank you!&amp;nbsp; -Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jan 2013 18:45:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-04T18:45:03Z</dc:date>
    <item>
      <title>How to sum(qty) within variable time period</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394696#M488837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have have a simple table containing an Order_Date, Order_No, and Qty.&amp;nbsp; I need to determine the highest sum(qty) for a variable date period.&amp;nbsp; For example, "What is the highest total qty ordered within any 3 day period?".&amp;nbsp; The number of days will be a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Struggling a lot with set analysis (still a few weeks until formal QV training) so any help would be appreciated.&amp;nbsp; Example QVW is attached.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 17:57:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394696#M488837</guid>
      <dc:creator />
      <dc:date>2013-01-04T17:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(qty) within variable time period</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394697#M488838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The forum is having problems at the moment. I received email from the forum that a reply was posted, but no reply appears for the post, and the email link in the notification was invalid.&amp;nbsp; If you post a response and do not see it here, please email it to me at &lt;A href="mailto:richard.tefft@scipax.com"&gt;richard.tefft@scipax.com&lt;/A&gt;.&amp;nbsp; Thank you!&amp;nbsp; -Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 18:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394697#M488838</guid>
      <dc:creator />
      <dc:date>2013-01-04T18:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(qty) within variable time period</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394698#M488839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached example. In the input box you can enter the length of the period. In the table below the highest value is highlighted. Scroll down to 04/02/2012 to find it. I haven't found a way to calculate only that value and display it in a text box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: I've added another example qvw with a bar chart that shows the value of the maximum period sum in the chart. So you can see it at a glance instead of having to scroll down a straight chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 20:10:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394698#M488839</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-01-04T20:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(qty) within variable time period</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394699#M488840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the info.&amp;nbsp; When you updated my Rolling Window Example I noticed you added filler records for all the days with no orders.&amp;nbsp; This would easily be millions of extra rows in our case and just isn't feasible to do for all the order data in our ETL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the Sales To Date file, the sum works until I add an additional list box to filter on SalesPerson.&amp;nbsp; The filter causes gaps in the dates and the expression returns incorrect results. The expression is working on X number of records below, where we need X number of days.&amp;nbsp; Our data will have gaps and the solution we need has to handle that without adding filler records in the ETL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One idea we have is to keep an isolated master calendar with 1 record for every date, and a Qty=0.&amp;nbsp; When the user makes their selection on the sales data, we would somehow union the calendar records with the selected data, and get a sum(qty) grouped by date.&amp;nbsp; This would give us 1 record per date and allow the BELOW function to work for us.&amp;nbsp; I'm from a SQL background so while I can express this in SQL terms, I can't get it in QV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pseudo-SQL would be something like this.&amp;nbsp; It acts like a dynamic filler (this keeping size manageable):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select date, sum(qty)&lt;/P&gt;&lt;P&gt;from (select user's date, user's qty from our data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; union&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select date, qty 0 from our calendar)&lt;/P&gt;&lt;P&gt;group by date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we could generate that, I believe we could adapt your expression to it since 1 row = 1 day.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;P&gt;Thanks for the help, &lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 17:44:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394699#M488840</guid>
      <dc:creator />
      <dc:date>2013-01-16T17:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum(qty) within variable time period</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394700#M488841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have found 2 different solutions.&amp;nbsp; Gysbert's idea to foce all records to appear was the key, creating an outer-join condition.&amp;nbsp; Thanks to instructor Mike Alegado, we now have a variable-based expression to calculate the window for each dimension value, and an AGGR expression to capture the highest value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second method is sneakier.&amp;nbsp; By putting an automatic Max&amp;nbsp; calculation on the exprsssion column in the chart, Qlikview can automatically calculate the max for us.&amp;nbsp; We then capture that value directly from the chart cell using VBScript (thanks forum!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached a sample file with the adjustable date range and both solutions implemented.&lt;/P&gt;&lt;P&gt;Thanks to all for the help,&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 14:21:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-qty-within-variable-time-period/m-p/394700#M488841</guid>
      <dc:creator />
      <dc:date>2013-01-28T14:21:38Z</dc:date>
    </item>
  </channel>
</rss>

