<?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 Help with Max and AGGR Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820575#M1213442</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a data like below, this same pattern is repeated for multiple LeaseIDs with different Periods. For some cases , like Mar-20 here, there are two lines against the same Type = Cash. In such cases I would only like to pick up the ones with maximum header id i.e Mar-20 , LeaseID=L1 ,Type= Cash should have 150 only .&lt;/P&gt;&lt;P&gt;Can you please help me create a set analysis expression or load script in Qlikview which will only load filtered data based on max header id as well as Period, Lease Id and Type and Amt.&lt;/P&gt;&lt;P&gt;I am trying to use the below expression&lt;/P&gt;&lt;P&gt;MAX(AGGR(Sum(Amt),LEASE_ID,HEADER_ID,Period,Type))&lt;/P&gt;&lt;P&gt;but for Mar -20 and Lease Id = L1 and Type = Cash it is picking up 250 instead of 150.&lt;/P&gt;&lt;P&gt;Can you please help?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ankhi_0-1625723009148.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/58220i93FAC52A340C0A3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ankhi_0-1625723009148.png" alt="Ankhi_0-1625723009148.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;Ankhi&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jul 2021 05:44:18 GMT</pubDate>
    <dc:creator>Ankhi</dc:creator>
    <dc:date>2021-07-08T05:44:18Z</dc:date>
    <item>
      <title>Help with Max and AGGR Function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820575#M1213442</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a data like below, this same pattern is repeated for multiple LeaseIDs with different Periods. For some cases , like Mar-20 here, there are two lines against the same Type = Cash. In such cases I would only like to pick up the ones with maximum header id i.e Mar-20 , LeaseID=L1 ,Type= Cash should have 150 only .&lt;/P&gt;&lt;P&gt;Can you please help me create a set analysis expression or load script in Qlikview which will only load filtered data based on max header id as well as Period, Lease Id and Type and Amt.&lt;/P&gt;&lt;P&gt;I am trying to use the below expression&lt;/P&gt;&lt;P&gt;MAX(AGGR(Sum(Amt),LEASE_ID,HEADER_ID,Period,Type))&lt;/P&gt;&lt;P&gt;but for Mar -20 and Lease Id = L1 and Type = Cash it is picking up 250 instead of 150.&lt;/P&gt;&lt;P&gt;Can you please help?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ankhi_0-1625723009148.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/58220i93FAC52A340C0A3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ankhi_0-1625723009148.png" alt="Ankhi_0-1625723009148.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;Ankhi&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 05:44:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820575#M1213442</guid>
      <dc:creator>Ankhi</dc:creator>
      <dc:date>2021-07-08T05:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Max and AGGR Function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820613#M1213449</link>
      <description>&lt;P&gt;Hi, Max returns the higher value, if you wantto sort by another field you can use FirstSortedValue:&lt;/P&gt;&lt;P&gt;-&amp;nbsp;Aggr(FirstSortedValue(Amt, -&lt;SPAN&gt;HEADER_ID&lt;/SPAN&gt;), &lt;SPAN&gt;LEASE_ID,&lt;/SPAN&gt;Period,Type)&lt;/P&gt;&lt;P&gt;- or:&amp;nbsp;FirstSortedValue(TOTAL &amp;lt;&lt;SPAN&gt;LEASE_ID,&lt;/SPAN&gt;Period,Type&amp;gt; Amt, -&lt;SPAN&gt;HEADER_ID&lt;/SPAN&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 07:27:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820613#M1213449</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-07-08T07:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Max and AGGR Function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820654#M1213457</link>
      <description>&lt;P&gt;Hi Ruben,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for getting back to me. But this is not working. I will try to explain my scenario in a bit ore detail&lt;/P&gt;&lt;P&gt;My application looks like below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ankhi_0-1625735034150.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/58240i413C7051E44EE7EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ankhi_0-1625735034150.png" alt="Ankhi_0-1625735034150.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The users can select any number of Periods as I have selected&amp;nbsp; and there are other filters as well.&lt;/P&gt;&lt;P&gt;This is the qvd data (below)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ankhi_2-1625735531985.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/58243i28D5DDE9E2BAE8C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ankhi_2-1625735531985.png" alt="Ankhi_2-1625735531985.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So for Type Amortization the application should pick the amount which has a header id of&amp;nbsp; 127590.&lt;/P&gt;&lt;P&gt;and for the rest of the Types, since there is only one row so picks up whatever there is ..&lt;/P&gt;&lt;P&gt;This qvd is filtered on Lease Id and Period. There are multiple Lease ids with different Types for different periods.&lt;/P&gt;&lt;P&gt;In case for the same lease id&amp;nbsp; and same period, if there is a repetition of Types as my example above , then the&amp;nbsp; amount of the line with highest header id should be picked up. (not the highest amount)&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ankhi&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 09:17:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820654#M1213457</guid>
      <dc:creator>Ankhi</dc:creator>
      <dc:date>2021-07-08T09:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Max and AGGR Function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820698#M1213460</link>
      <description>&lt;P&gt;Hi, fisrtsortedvalue returns the value of the highest header id (not the highest amount), if doesn't works it can be related with the dimensoion or the type of chart used.&lt;/P&gt;&lt;P&gt;Can you create a dummy document with a few inline data that demonstrates the issue? this way we can use that document to make it work.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 10:29:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1820698#M1213460</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-07-08T10:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Max and AGGR Function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1821370#M1213546</link>
      <description>&lt;P&gt;Hi Rubenmarin,&lt;/P&gt;&lt;P&gt;I have found out there are a lot of data issues at the source. We are waiting for the data to be fixed at the source as of now. Once done if this issue still persists then we definitely get back.&lt;/P&gt;&lt;P&gt;Thanks again for getting back to me .&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ankhi&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 09:44:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Max-and-AGGR-Function/m-p/1821370#M1213546</guid>
      <dc:creator>Ankhi</dc:creator>
      <dc:date>2021-07-12T09:44:16Z</dc:date>
    </item>
  </channel>
</rss>

