<?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: Sum of Values from this date and 2 dates back in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266666#M856757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply use accumulate option(steps 2) for that expression.&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;By using rangesum() function also we can get the results.Use below expression&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt;"&gt;=RangeSum(above(sum(sales),0,2))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="151427" alt="11.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/151427_11.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="151428" alt="12.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/151428_12.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jan 2017 14:07:48 GMT</pubDate>
    <dc:creator>sravanthialuval</dc:creator>
    <dc:date>2017-01-31T14:07:48Z</dc:date>
    <item>
      <title>Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266665#M856756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a picture below, there is a problem I'm facing. I believe the solution can't be that hard, but iz seems that I'm missing it.&lt;/P&gt;&lt;P&gt;Simple Sales data (sales and calendar table in data model).&lt;/P&gt;&lt;P&gt;Straight table that contains "Date" dimension and&amp;nbsp; expression "sum of Quantity on that Date + Previous 2 Dates".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WantedValue in picture is something that I want, but can't figure out how.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional Note: Calculation should be aware that there could be data before 1.7.2016 and has to take it into account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Pic1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/151442_Pic1.PNG" style="font-size: 13.3333px;" /&gt;&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;Regards,&lt;/P&gt;&lt;P&gt;Luka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266665#M856756</guid>
      <dc:creator>lukacvetko</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266666#M856757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply use accumulate option(steps 2) for that expression.&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;By using rangesum() function also we can get the results.Use below expression&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt;"&gt;=RangeSum(above(sum(sales),0,2))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="151427" alt="11.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/151427_11.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="151428" alt="12.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/151428_12.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 14:07:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266666#M856757</guid>
      <dc:creator>sravanthialuval</dc:creator>
      <dc:date>2017-01-31T14:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266667#M856758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sravanthi aluvala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for answering. This partially solves the problem.&lt;/P&gt;&lt;P&gt;The question remains with two problems:&lt;/P&gt;&lt;P&gt;1. what if there is no sales on all dates. (I want data from this date and 2 previous dates, and not for this date and two previous dates that have sales documents (not all dates appear in table))&lt;/P&gt;&lt;P&gt;2. I selected July, but we have to be aware that there is data in Month before (June), and that data too has to be calculated. It means that a first row in table doesn't necessarily contain just it's own value, but maybe values from 30.6.2016 and 29.6.2016).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 14:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266667#M856758</guid>
      <dc:creator>lukacvetko</dc:creator>
      <dc:date>2017-01-31T14:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266668#M856759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Sum({&amp;lt; Date = {'&amp;gt;= $(=Date(Max(datefield)-2)) &amp;lt;= $(=Date(Max(Datefield)))' } &amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share a sample app to work on?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 14:38:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266668#M856759</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2017-01-31T14:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266669#M856760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunatelly no, this is not an answer.&lt;/P&gt;&lt;P&gt;I attached a sample app in Question above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 14:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266669#M856760</guid>
      <dc:creator>lukacvetko</dc:creator>
      <dc:date>2017-01-31T14:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266670#M856761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain this by using one or two examples from your sample application?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 15:13:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266670#M856761</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2017-01-31T15:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266671#M856762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;above(sum(Quantity),2)+above(sum(Quantity),1)+sum(Quantity)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sangeetha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 16:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266671#M856762</guid>
      <dc:creator>sangeess21</dc:creator>
      <dc:date>2017-01-31T16:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266672#M856763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hi Luke,&amp;nbsp; may be try this&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;above(rangesum(below (sum(sales),0,2)),1)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 17:44:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266672#M856763</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2017-01-31T17:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266673#M856764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;We had sales on 1.7.2016, on 2.7.2016 and 4.7.2016. We had no sales on 3.7.2016 (that means that 3.7.2016 will not show in dimension list). It means that a rangesum(above()) will not work, beacuse I want that this calculation takes 3.7.2016 in consideration also. On 4.7.2016 there has to be a Sum from 4.7.2016 + 3.7.2016 (it was zero) + value from 2.7.2016.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;On 30.6.2016 we sold a quantity of 176, on 1.7.2016 we sold 96 and on 2.7.2016 we sold 24.&lt;/P&gt;&lt;P&gt;Let's say that a front end user selects in his filters Year=2016 and Month=7.&lt;/P&gt;&lt;P&gt;For dimension value 2.7.2016 in my example I want a value 24+96+176=296&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 08:36:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266673#M856764</guid>
      <dc:creator>lukacvetko</dc:creator>
      <dc:date>2017-02-01T08:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266674#M856765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Close, but it still doesn't solve 2 problems that I mentioned in a reply to &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sravanthi Aluvala&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 08:38:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266674#M856765</guid>
      <dc:creator>lukacvetko</dc:creator>
      <dc:date>2017-02-01T08:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266675#M856766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hi. Close, but it still doesn't solve 2 problems that I mentioned in a reply to &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sravanthi Aluvala&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 08:39:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266675#M856766</guid>
      <dc:creator>lukacvetko</dc:creator>
      <dc:date>2017-02-01T08:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266676#M856767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have reduced data from your application and added few codes in script as well.&lt;/P&gt;&lt;P&gt;Let me know whether this will help you or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 09:38:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266676#M856767</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2017-02-01T09:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266677#M856768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much. I believe this is a right solution.&lt;/P&gt;&lt;P&gt;Just one additional question, why *avg(1) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 10:03:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266677#M856768</guid>
      <dc:creator>lukacvetko</dc:creator>
      <dc:date>2017-02-01T10:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266678#M856769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a dummy field which will not make any changes.. but without that if you select any month, year or any calendar field, it will not ignore those lines..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just remove Avg(1) from my expression and select any monthyear and see the effect. You will understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 10:06:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266678#M856769</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2017-02-01T10:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Values from this date and 2 dates back</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266679#M856770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Understood. Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 10:08:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-of-Values-from-this-date-and-2-dates-back/m-p/1266679#M856770</guid>
      <dc:creator>lukacvetko</dc:creator>
      <dc:date>2017-02-01T10:08:39Z</dc:date>
    </item>
  </channel>
</rss>

