<?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 between different date ranges in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206853#M874856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking for a max date by Shop and Item? If that is not the case, try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum({&amp;lt;Year=, Month=, Quarter=, Week=, Data=,Day=, DataNum={"&amp;gt;=$(=Max(Stocktaking))&amp;lt;=$(=Num(Today()))"}&amp;gt;}Incomes)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Otherwise, provide more details?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Nov 2016 16:33:32 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-11-03T16:33:32Z</dc:date>
    <item>
      <title>Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206852#M874855</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;I've got problem i got&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shop,Items, Stocktaking(date)&lt;/P&gt;&lt;P&gt;1,1,2015-11-25&lt;/P&gt;&lt;P&gt;1,2,2016-09-01&lt;/P&gt;&lt;P&gt;1,3,2016-10-18&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using pivot table and I'm trying to get value of stock(income and expenditure) but when i'm using expression : &lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Year=, Month=, Quarter=, Week=, Data=,Day=,&lt;/P&gt;&lt;P&gt;DataNum={"&amp;gt;=$(=Num(aggr(max(Stocktaking),Shop,Items)))&amp;lt;=$(=Num(Today()))"}&amp;gt;}Incomes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's doing it wrong, becouse when it finds different dates (stocktaking dates) it shows in sum as '-' and summing it from 2015-01-01(first date in DB). If i select just item 1 it shows ok, if i do not select anything it shows wrong. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone any idea how to solve it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Grzegorz&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-between-different-date-ranges/m-p/1206852#M874855</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206853#M874856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking for a max date by Shop and Item? If that is not the case, try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum({&amp;lt;Year=, Month=, Quarter=, Week=, Data=,Day=, DataNum={"&amp;gt;=$(=Max(Stocktaking))&amp;lt;=$(=Num(Today()))"}&amp;gt;}Incomes)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Otherwise, provide more details?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 16:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206853#M874856</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-03T16:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206854#M874857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Grzegorz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({&amp;lt;Year=, Month=, Quarter=, Week=, Data=,Day=, DataNum={"&amp;gt;=$(=num(Max(total Stocktaking)))&amp;lt;=$(=Num(Today()))"}&amp;gt;}Incomes)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;KC&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 16:44:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206854#M874857</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2016-11-03T16:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206855#M874858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, thanks for answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that every single item in every single shop can have different Stocktaking date it's why im aggr dates by items and by shops.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;and value of stock im counting as value after stocktaking and adding income minus &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;expenditure till now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If i will do just max(Stocktaking) it will show max date for every item same when i got :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Shop,Item,Stocktaking(date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1,1,2015-11-25&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1,2,2016-09-01&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1,3,2016-10-18&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;It will show for item 1,2,3 date correctly but it will count from 2016-10-18 till Today&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Grzegorz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2016 09:07:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206855#M874858</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-04T09:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206856#M874859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(FirstSortedValue(Incomes, -&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Stocktaking), Shop, Item))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2016 16:12:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206856#M874859</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-04T16:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206857#M874860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks for replyin,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried but it shows just zeros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attaching sample maybe it will make it a lil bit more clear what problem im facing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Grzegorz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 11:22:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206857#M874860</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-07T11:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206858#M874861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this look like what you wanted?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/143177_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression used:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(FirstSortedValue(Value, -&lt;SPAN style="color: #ff0000;"&gt;Date1&lt;/SPAN&gt;), Shop, Items))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2016 01:32:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206858#M874861</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-08T01:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206859#M874862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,i think so thank you very much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have check it for one more record for Item 1, Shop 1. And it takes just last value. when it should sum between stocktaking date till last day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attaching sample with this one more record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Grzegorz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2016 06:37:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206859#M874862</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-08T06:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206860#M874863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(If(Stocktaking &amp;lt;= Date1, Value), Shop, Items, Date1))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="143238" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/143238_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2016 12:05:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206860#M874863</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-08T12:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sum between different date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206861#M874864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's exacly what i need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much. &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, 08 Nov 2016 12:27:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-between-different-date-ranges/m-p/1206861#M874864</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-08T12:27:28Z</dc:date>
    </item>
  </channel>
</rss>

