<?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 function below(sum(x),A,B) make all arguments calculated in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263617#M99140</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nowaitaka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have a very good point. It would be best to perform such calculations through SQL or other means during loading instead of performing calculations on the fly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2011 17:35:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-07T17:35:44Z</dc:date>
    <item>
      <title>function below(sum(x),A,B) make all arguments calculated</title>
      <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263614#M99137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my first thread on this community - pls be patient if I,m not precisely &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; thx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im trying to get things work with this function. In QV help is written: below(sum(value1),1,3) lets you look back to previous 3 rows on load statement and sum value1 from this previous 3 row and insert this sum to current row. &lt;/P&gt;&lt;P&gt;Argument "3" is static. Ist there any trick to make this argument calculable in my case depending on values in previous rows? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say we have a table with dates sorted ascending but they appear not day after day. For each day we have no. of sold cars. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 155px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="17" width="71"&gt;date&lt;/TD&gt;&lt;TD width="84"&gt;no. Sold cars&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-01&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-03&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-06&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-06-07&lt;/TD&gt;&lt;TD align="right"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-06-08&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-06-13&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-06-15&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-06-16&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-06-19&lt;/TD&gt;&lt;TD align="right"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;based on this table i`d like to add 2 extra columns that stores info about avg sum. of sold cars in previous 7 days and 14 days from current date in row. It can looks like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 314px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="51" width="71"&gt;date&lt;/TD&gt;&lt;TD width="84"&gt;no. Sold cars&lt;/TD&gt;&lt;TD class="xl25" width="78"&gt;7 days back from current day&lt;/TD&gt;&lt;TD class="xl25" width="81"&gt;14 days back from current day&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-01&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-03&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;6&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-06&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;7&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-07&lt;/TD&gt;&lt;TD align="right"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;12&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-08&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;14&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-10&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;13&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-12&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;15&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-13&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;18&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl24" height="17"&gt;2011-04-15&lt;/TD&gt;&lt;TD align="right"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl25" width="78"&gt;14&lt;/TD&gt;&lt;TD align="right" class="xl25" width="81"&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and on date 2011-04-15 for 14 days back sold 4+1+5+4+3+2+4+5 = 28 cars, and&amp;nbsp; 2011-04-12 for 7 days back sold 1+5+4+3+2 = 15&lt;/P&gt;&lt;P&gt;to sum no of cars function below shoud look back deeper in previous row only if date in that row is not older than 7/14 days from date from current row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it has to be calulated while load script in code, not in layout layer (pivot, set analysis ...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your tips.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 11:48:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263614#M99137</guid>
      <dc:creator />
      <dc:date>2011-06-03T11:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: function below(sum(x),A,B) make all arguments calculated</title>
      <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263615#M99138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nowaitaka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could create a link between the table containing # of cars sold and a calendar date such as below:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;CarsSold:&lt;/P&gt;&lt;P&gt;load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;CalendarDate,no. Sold cars&lt;/P&gt;&lt;P&gt;2011-04-01,2&lt;/P&gt;&lt;P&gt;2011-04-03,4&lt;/P&gt;&lt;P&gt;2011-04-06,1&lt;/P&gt;&lt;P&gt;2011-06-07,5&lt;/P&gt;&lt;P&gt;2011-06-08,4&lt;/P&gt;&lt;P&gt;2011-06-13,3&lt;/P&gt;&lt;P&gt;2011-06-15,2&lt;/P&gt;&lt;P&gt;2011-06-16,4&lt;/P&gt;&lt;P&gt;2011-06-19,5&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates:&lt;/P&gt;&lt;P&gt;load * inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;CalendarDate&lt;/P&gt;&lt;P&gt;2011-04-01&lt;/P&gt;&lt;P&gt;2011-04-02&lt;/P&gt;&lt;P&gt;2011-04-03&lt;/P&gt;&lt;P&gt;2011-04-04&lt;/P&gt;&lt;P&gt;2011-04-05&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;2011-06-26&lt;/P&gt;&lt;P&gt;2011-06-27&lt;/P&gt;&lt;P&gt;2011-06-28&lt;/P&gt;&lt;P&gt;2011-06-29&lt;/P&gt;&lt;P&gt;2011-06-30&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a straight table and use the following dimensions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Calendar date&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the following Expressions to get sum of sales starting N days before the date in the row through the date in the row:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sum([no. Sold cars])&lt;/LI&gt;&lt;LI&gt;RangeSum(above(sum([no. Sold cars]), 0, 7))&lt;/LI&gt;&lt;LI&gt;RangeSum(above(sum([no. Sold cars]), 0, 14))&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could swap &lt;STRONG&gt;above&lt;/STRONG&gt; with &lt;STRONG&gt;below&lt;/STRONG&gt; to get the sum of sales starting the date in the row and ending after N calendar days.You probably don't even need sum function in the last 2 expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/johnw"&gt;John&lt;/A&gt; has answered a similar question about &lt;A _jive_internal="true" href="https://community.qlik.com/message/8837#8837"&gt;everyday sum of past 5 days&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: QueueWeRavn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 18:16:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263615#M99138</guid>
      <dc:creator />
      <dc:date>2011-06-03T18:16:52Z</dc:date>
    </item>
    <item>
      <title>function below(sum(x),A,B) make all arguments calculated</title>
      <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263616#M99139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/queueweravn" id="jive-540062816139878468144" onmouseout="" onmouseover=""&gt;QueueWeRavn&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx for your tip, this solution works partially.&lt;/P&gt;&lt;P&gt;If U do not make any selections in app that affects the dates, works fine - it takes previous 7/14 rows from stright table where we have days day by day which gives us 1 week and 2 weeks back...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if U make selection in app that results in excuding some dates (like shops in City1 in last week sold cars only in monday and friday and not in each day) the stright table will show less dates but it`ll calculate expression "RangeSum(above(sum([no. Sold cars]), 0, 7))"&amp;nbsp; from last 7 rows in this table (but previous 7 rows contains dates that are older than 7 days). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That`s why I was thinking about calculating this expression in data load script to avoid such situation...&lt;/P&gt;&lt;P&gt;My bad is that I didn`t mentioned about this selecions before &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is example output from this stright table...&lt;/P&gt;&lt;P&gt;exp1 =RangeSum(above(sum(D_EFECTIVELY_FREE_FIRST_SHORTER_PERIOD), 0, 7))&lt;/P&gt;&lt;P&gt;exp2 =sum(D_EFECTIVELY_FREE_FIRST_SHORTER_PERIOD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exp1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exp2&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 223px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" width="98"&gt;2011-06-01&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none;" width="53"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none;" width="72"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-03&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;16&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-05&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;62&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;46&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-08&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;151&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;89&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-10&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;206&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-12&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;251&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-15&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;514&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;265&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-17&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;707&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;207&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-19&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;752&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;91&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-22&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;853&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;190&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-24&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;828&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-26&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;840&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;57&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" style="border-top: medium none;"&gt;2011-06-29&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;845&lt;/TD&gt;&lt;TD align="right" class="xl24" style="border-left: medium none; border-top: medium none;"&gt;270&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if U tak any date it sums previous 7 rows even if this previous date is older than 7 days (it does not interprets the date - only takes 7 rows back... )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 13:19:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263616#M99139</guid>
      <dc:creator />
      <dc:date>2011-06-07T13:19:32Z</dc:date>
    </item>
    <item>
      <title>function below(sum(x),A,B) make all arguments calculated</title>
      <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263617#M99140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nowaitaka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have a very good point. It would be best to perform such calculations through SQL or other means during loading instead of performing calculations on the fly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 17:35:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263617#M99140</guid>
      <dc:creator />
      <dc:date>2011-06-07T17:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: function below(sum(x),A,B) make all arguments calculated</title>
      <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263618#M99141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd suggest the solution in the link that QueueWeRavn posted.&amp;nbsp; It doesn't require functions like above(), and it doesn't require you to precalculate the values.&amp;nbsp; It just requires that you build a data model that "understands" what it means to be within the past 7 days or 14 days.&amp;nbsp; There are more efficient ways to build this data (while loops), but this will probably be fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[AsOf]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD date(fieldvalue('Date',recno())) as "Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE fieldvaluecount('Date')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;OUTER JOIN ([AsOf])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD "Date" as "As of Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [AsOf]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;OUTER JOIN ([AsOf])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Date Type&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Current Day&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Rolling 7 Days&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Rolling 14 Days&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INNER JOIN ([AsOf])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [AsOf]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHERE (&amp;nbsp;&amp;nbsp; "Date Type"='Current Day' &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND "Date"="As of Date")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; OR&amp;nbsp; (&amp;nbsp;&amp;nbsp; "Date Type"='Rolling 7 Days'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND "Date"&amp;gt;="As of Date"-7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND "Date"&amp;lt;="As of Date")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; OR&amp;nbsp; (&amp;nbsp;&amp;nbsp; "Date Type"='Rolling 14 Days'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND "Date"&amp;gt;="As of Date"-14&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND "Date"&amp;lt;="As of Date")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then build a pivot table like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension 1 = "As of Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension 2 = "Date Type" // move to top&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression&amp;nbsp; = sum([no. Sold cars])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of the intelligence is in the data model, which is why the chart itself can be so simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hmmm, let me tack a crack at the while loops approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Dates]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD date(fieldvalue('Date',recno())) as "Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE fieldvaluecount('Date')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[AsOf]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;"Date" as "As of Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,'Current Day' as "Date Type"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,"Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Dates]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE ([AsOf])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;"Date" as "As of Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,'Rolling 7 Days' as "Date Type"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,date("Date"+1-iterno()) as "Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Dates]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHILE iterno() &amp;lt;= 7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE ([AsOf])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;"Date" as "As of Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,'Rolling 14 Days' as "Date Type"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,date("Date"+1-iterno()) as "Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Dates]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHILE iterno() &amp;lt;= 14&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INNER JOIN ([AsOf])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD "Date"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Dates]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP TABLE [Dates]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 23:50:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263618#M99141</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-06-07T23:50:39Z</dc:date>
    </item>
    <item>
      <title>function below(sum(x),A,B) make all arguments calculated</title>
      <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263619#M99142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE statement with iterno() , RecNo() and peek() did the trick in my case &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;. I thought native functions below/above will be the best solution but looks like while statement in LOAD is also optimized in QV so it works good enought for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like i have to do some research about good practise while develop model in QV. &lt;/P&gt;&lt;P&gt;Thanks to you both for help, cheers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my solution from real code (car sale model was only example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Mytab:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; &lt;/P&gt;&lt;P&gt; D_DEPARTURE_DATE as D_DEPARTURE_DATE_14 ,&lt;/P&gt;&lt;P&gt; D_DESTINATION as D_DESTINATION_14,&lt;/P&gt;&lt;P&gt;peek('D_EFECTIVELY_FREE_SEATS_14',RecNo()-IterNo(),'DEPARTURESv5') as D_TO_SUM_14&lt;/P&gt;&lt;P&gt;resident DEPARTURESv5&lt;/P&gt;&lt;P&gt; while&lt;/P&gt;&lt;P&gt; (RecNo()-IterNo())&amp;gt;-1 and date(date(D_DEPARTURE_DATE)-13) &amp;lt;= date(peek('D_DEPARTURE_DATE',RecNo()-IterNo(),'DEPARTURESv5')) and D_DESTINATION = peek('D_DESTINATION',RecNo()-IterNo(),'DEPARTURESv5');&lt;/P&gt;&lt;P&gt; //RowNo() 1-&amp;gt;&lt;/P&gt;&lt;P&gt; //IterNo() 1-&amp;gt;&lt;/P&gt;&lt;P&gt; //peek 0-&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then group by&amp;nbsp; and sum(D_TO_SUM_14) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 10:38:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263619#M99142</guid>
      <dc:creator />
      <dc:date>2011-06-10T10:38:10Z</dc:date>
    </item>
    <item>
      <title>function below(sum(x),A,B) make all arguments calculated</title>
      <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263620#M99143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nowaitaka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great! I learnt something new from your implementation as well. Thank you for sharing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 13:01:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263620#M99143</guid>
      <dc:creator />
      <dc:date>2011-06-10T13:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: function below(sum(x),A,B) make all arguments calculated</title>
      <link>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263621#M99144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome! this really helped me. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2012 22:25:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/function-below-sum-x-A-B-make-all-arguments-calculated/m-p/263621#M99144</guid>
      <dc:creator />
      <dc:date>2012-01-17T22:25:00Z</dc:date>
    </item>
  </channel>
</rss>

