<?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 sum with firstsortedvalue and/or aggr - Problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211112#M65482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Riccardo,&lt;/P&gt;&lt;P&gt;let's try to construct your formula...&lt;/P&gt;&lt;P&gt;The max value should look like this:&lt;/P&gt;&lt;P&gt;AGGR( MAX(VALUE), NETWORK_NAME, BOOKING_NUMBER, TRX_NUMBER).&lt;/P&gt;&lt;P&gt;this aggregation can be summarized:&lt;/P&gt;&lt;P&gt;SUM(AGGR( MAX(VALUE), NETWORK_NAME, BOOKING_NUMBER, TRX_NUMBER))&lt;/P&gt;&lt;P&gt;To get summaries by Network and Booking#, use them as dimensions in your chart.&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="refHTML"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Dec 2010 15:56:06 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2010-12-02T15:56:06Z</dc:date>
    <item>
      <title>sum with firstsortedvalue and/or aggr - Problem</title>
      <link>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211111#M65481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All&lt;BR /&gt;i have a situation like these:&lt;BR /&gt;&lt;BR /&gt;NETWORK_NAME TRX_DATE TRX_NUMBER TRX_CLASS VALUE BOOKING_NUMBER LAST_UPDATE_DATE&lt;BR /&gt;OPEN TRAVEL NETWORK STANDARD 12/08/2006 00:00:00 ORIT060215286 payment -8.457,16 3517061 12/08/2006 00:00:00&lt;BR /&gt;OPEN TRAVEL NETWORK STANDARD 01/17/2007 00:00:00 ORIT070005481 Invoice 8.457,16 3517061 01/17/2007 00:00:00&lt;BR /&gt;OPEN TRAVEL NETWORK STANDARD 10/22/2010 00:00:00 ORIT100243613 Invoice 2.649,48 8554923 10/22/2010 00:00:00&lt;BR /&gt;OPEN TRAVEL NETWORK STANDARD 10/22/2010 00:00:00 ORIT100243613 Invoice 2.649,48 8554923 10/25/2010 00:00:00&lt;BR /&gt;&lt;BR /&gt;what i need to do is a sum of VALUE for NETWORK_NAME and BOOKING_NUMBER , but for the same TRX_NUMBER (see record 3 and 4) i must read only the record with max LAST_UPDATE_DATE.&lt;BR /&gt;&lt;BR /&gt;I have tryed with firstsortedvalue with aggr function but don't work fine.&lt;BR /&gt;&lt;BR /&gt;Any idea?&lt;BR /&gt;&lt;BR /&gt;Thank's in advance&lt;BR /&gt;Riccardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 15:03:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211111#M65481</guid>
      <dc:creator />
      <dc:date>2010-12-02T15:03:14Z</dc:date>
    </item>
    <item>
      <title>sum with firstsortedvalue and/or aggr - Problem</title>
      <link>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211112#M65482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Riccardo,&lt;/P&gt;&lt;P&gt;let's try to construct your formula...&lt;/P&gt;&lt;P&gt;The max value should look like this:&lt;/P&gt;&lt;P&gt;AGGR( MAX(VALUE), NETWORK_NAME, BOOKING_NUMBER, TRX_NUMBER).&lt;/P&gt;&lt;P&gt;this aggregation can be summarized:&lt;/P&gt;&lt;P&gt;SUM(AGGR( MAX(VALUE), NETWORK_NAME, BOOKING_NUMBER, TRX_NUMBER))&lt;/P&gt;&lt;P&gt;To get summaries by Network and Booking#, use them as dimensions in your chart.&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="refHTML"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 15:56:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211112#M65482</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-12-02T15:56:06Z</dc:date>
    </item>
    <item>
      <title>sum with firstsortedvalue and/or aggr - Problem</title>
      <link>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211113#M65483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg&lt;/P&gt;&lt;P&gt;i'm not sure to understand your solution ... i'm trying to explain better my problem.&lt;/P&gt;&lt;P&gt;i'have 2 record for the same invoice , but with different "last_update_date". For these i must read the record with the max last_update_date.&lt;/P&gt;&lt;P&gt;I used this formula but it seem been wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AGGR(ENT_CURR_AMOUNT_DUE_REMAINING,TRX_NUMBER,TRX_CLASS,BOOKING_NUMBER) and after ..&lt;/P&gt;&lt;P&gt;firstsortedvalue(AGGR(ENT_CURR_AMOUNT_DUE_REMAINING,TRX_NUMBER,TRX_CLASS,BOOKING_NUMBER),-LAST_UPDATE_DATE)&lt;/P&gt;&lt;P&gt;The error is that the system read the first record and not the second.. :-/. and don't sum correctly .. :-((&lt;/P&gt;&lt;P&gt;I attached my application .. if you wont to see "OPEN TRAVEL NETWORK " ex.&lt;/P&gt;&lt;P&gt;Thank'you so much.&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 17:10:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211113#M65483</guid>
      <dc:creator />
      <dc:date>2010-12-02T17:10:05Z</dc:date>
    </item>
    <item>
      <title>sum with firstsortedvalue and/or aggr - Problem</title>
      <link>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211114#M65484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Riccardo,&lt;/P&gt;&lt;P&gt;OK, then replace my MAX with the firstsortedvalue. You can construct this expression from the middle, "inside out":&lt;/P&gt;&lt;P&gt;First, construct your FirstSortedValue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue(ENT_CURR_AMOUNT_DUE_REMAINING, LAST_UPDATE_DATE * -1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, enclose it in the AGGR:&lt;/P&gt;&lt;P&gt;AGGR(&lt;/P&gt;&lt;P&gt;FirstSortedValue(ENT_CURR_AMOUNT_DUE_REMAINING, LAST_UPDATE_DATE * -1)&lt;/P&gt;&lt;P&gt;, TRX_NUMBER,TRX_CLASS,BOOKING_NUMBER)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then, enclose AGGR insude SUM:&lt;/P&gt;&lt;P&gt;SUM( AGGR(...) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="refHTML"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 18:41:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211114#M65484</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-12-02T18:41:04Z</dc:date>
    </item>
    <item>
      <title>sum with firstsortedvalue and/or aggr - Problem</title>
      <link>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211115#M65485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like:&lt;/P&gt;&lt;P&gt;aggr(&lt;/P&gt;&lt;P&gt;if(Last Update Date=max(total &amp;lt;Invoice Number&amp;gt; Last Update Date),&lt;/P&gt;&lt;P&gt;Invoice Amount&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;,Invoice Number, Invoice Update Date&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't put your actual field names in there but hopefully you get the point. That's only going to work if you have like invoice number or customer number or something as a dimension. Otherwise, put sum before the aggr and end the sum at the bottom.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 18:42:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211115#M65485</guid>
      <dc:creator />
      <dc:date>2010-12-02T18:42:22Z</dc:date>
    </item>
    <item>
      <title>sum with firstsortedvalue and/or aggr - Problem</title>
      <link>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211116#M65486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all&lt;/P&gt;&lt;P&gt;i have tryed both solution.&lt;/P&gt;&lt;P&gt;just for information the solution with firstsortedvalued have sort problem (read the min last_update_date and not the max .. and i don't understand why.&lt;/P&gt;&lt;P&gt;the second solution work fine.&lt;/P&gt;&lt;P&gt;1)sum(aggr(FirstSortedValue(ENT_CURR_AMOUNT_DUE_REMAINING, LAST_UPDATE_DATE *-1),TRX_NUMBER,TRX_CLASS,BOOKING_NUMBER))&lt;/P&gt;&lt;P&gt;2) aggr(if(LAST_UPDATE_DATE=max(total &amp;lt;TRX_NUMBER&amp;gt; LAST_UPDATE_DATE),ENT_CURR_AMOUNT_DUE_REMAINING ),TRX_NUMBER, LAST_UPDATE_DATE)&lt;/P&gt;&lt;P&gt;Thank's again .&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 19:29:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-with-firstsortedvalue-and-or-aggr-Problem/m-p/211116#M65486</guid>
      <dc:creator />
      <dc:date>2010-12-02T19:29:27Z</dc:date>
    </item>
  </channel>
</rss>

