<?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 each last value by field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199156#M880229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for late reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to build a solution thanks to your contributions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Nov 2016 12:33:15 GMT</pubDate>
    <dc:creator>Hakim-A</dc:creator>
    <dc:date>2016-11-21T12:33:15Z</dc:date>
    <item>
      <title>Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199148#M880220</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 am facing a problem I can't solve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data like this :&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="140740" alt="tab1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/140740_tab1.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I'd like to display for each chassis 1, 2 &amp;amp; 3 the sum of each last value of counter (by last value, it is the value of counter where day=max(day)) for all variants, so this result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="140741" alt="result.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/140741_result.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could then filter on a certain variant and see the value for this specific variant&lt;/P&gt;&lt;P&gt;For example if I select A &amp;amp; C I'd have :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="140742" alt="a&amp;amp;amp;c.PNG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/140742_a&amp;amp;c.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your contribution, it really drives me crazy not to find a way to solve this.&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-each-last-value-by-field/m-p/1199148#M880220</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199149#M880221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How you are calculating Sum Latest Counter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Oct 2016 18:04:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199149#M880221</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2016-10-15T18:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199150#M880222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this expression:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum(Aggr(FirstSortedValue(Counter, -Day), Chassis, Variant))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/140748_Capture.PNG" style="height: 117px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Oct 2016 21:45:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199150#M880222</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-15T21:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199151#M880223</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;Thanks for the quick replies.&lt;/P&gt;&lt;P&gt;Sum latest counter is calculated as so = For each chassis we sum the values of counter of all distinct Variant where day=max(day)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sunny, your solution is not working I tried it with my data and I've errors.&lt;/P&gt;&lt;P&gt;See enclosed if you select chassis b-749444 and variant u3000 then the result is 20 and it should be 39 787&lt;/P&gt;&lt;P&gt;In fact there are double values for this chassis and variant so I think QV is confused&lt;/P&gt;&lt;P&gt;See in the excel file you'll understand immediately&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Oct 2016 09:01:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199151#M880223</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2016-10-16T09:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199152#M880224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean 39867?&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/140787_Capture.PNG" style="height: 228px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be try this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum(Aggr(FirstSortedValue(Aggr(Sum(counter), chassis, variant), -Aggr(day, chassis, variant)), chassis, variant))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Oct 2016 21:59:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199152#M880224</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-16T21:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199153#M880225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually the result should be 39 792 : 1+13+1+5+6+39766&lt;/P&gt;&lt;P&gt;For each chassis having the same variant and same day we should take the maximum of counter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula is yet not valid really strange&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for contribution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 06:58:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199153#M880225</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2016-10-17T06:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199154#M880226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi hakim,&lt;/P&gt;&lt;P&gt;You can flag your data on script:&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(day) as day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; chassis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; variant,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as LastDayFlag&lt;/P&gt;&lt;P&gt;RESIDENT Sheet3&lt;/P&gt;&lt;P&gt;GROUP BY chassis, variant;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, on your expression:&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;LastDayFlag={1}&amp;gt;}counter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 07:29:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199154#M880226</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-17T07:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199155#M880227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a new information which you did not tell before. Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum(Aggr(FirstSortedValue(Aggr(&lt;SPAN style="color: #ff0000;"&gt;Max&lt;/SPAN&gt;(counter), chassis, variant), -Aggr(day, chassis, variant)), chassis, variant))&lt;/STRONG&gt;&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/140869_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 16:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199155#M880227</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-17T16:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sum each last value by field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199156#M880229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for late reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to build a solution thanks to your contributions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 12:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-each-last-value-by-field/m-p/1199156#M880229</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2016-11-21T12:33:15Z</dc:date>
    </item>
  </channel>
</rss>

