<?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: Aggr / Max / FirstSorted Problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-Max-FirstSorted-Problem/m-p/20649#M3436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny, as always you've got the perfect answer! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Feb 2018 16:30:08 GMT</pubDate>
    <dc:creator>chris1987</dc:creator>
    <dc:date>2018-02-27T16:30:08Z</dc:date>
    <item>
      <title>Aggr / Max / FirstSorted Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Max-FirstSorted-Problem/m-p/20647#M3434</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;I'm really struggling with the following and would appreciate some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple table with the following Info in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SalesRep&lt;/LI&gt;&lt;LI&gt;QuoteNo&lt;/LI&gt;&lt;LI&gt;VersionNo&lt;/LI&gt;&lt;LI&gt;LineNo&lt;/LI&gt;&lt;LI&gt;Qty&lt;/LI&gt;&lt;LI&gt;Status&lt;/LI&gt;&lt;LI&gt;LineValue&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is a summary table which will show all of the information, but only for the highest quote number. So in the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SalesRep - The name of the Rep&lt;/LI&gt;&lt;LI&gt;QuoteNo - The quote number&lt;/LI&gt;&lt;LI&gt;VersionNo - This highest version number on the quote&lt;/LI&gt;&lt;LI&gt;NoOfLines - Number of lines on the above quote and version&lt;/LI&gt;&lt;LI&gt;TotalQty - Total Quantity of items on the above quote and version&lt;/LI&gt;&lt;LI&gt;Status - Status of the quote and version&lt;/LI&gt;&lt;LI&gt;TotalLineValue - a total value of all the LineValue on the quote and version&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for example, here's the data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;SalesRep,Quote,Version,LineNo,Qty,Status,LineValue,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris,00001,1,1,10,C,100,&lt;/P&gt;&lt;P&gt;Chris,00001,1,2,5,C,100,&lt;/P&gt;&lt;P&gt;Chris,00001,1,3,10,C,100,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris,00001,2,1,10,I,200,&lt;/P&gt;&lt;P&gt;Chris,00001,2,2,10,I,200,&lt;/P&gt;&lt;P&gt;Chris,00001,2,3,10,I,200,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris,00001,3,1,20,O,300,&lt;/P&gt;&lt;P&gt;Chris,00001,3,2,20,O,300,&lt;/P&gt;&lt;P&gt;Chris,00001,3,3,20,O,300,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John,00002,1,1,1,O,500,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John,00003,1,1,5,O,300,&lt;/P&gt;&lt;P&gt;John,00003,2,1,5,O,300,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob,00004,1,1,5,O,400,&lt;/P&gt;&lt;P&gt;Bob,00004,2,1,5,O,400,&lt;/P&gt;&lt;P&gt;Bob,00004,3,1,5,I,500&lt;/P&gt;&lt;P&gt;Bob,00004,3,2,25,I,500&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I need the output to look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;SaleRep&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Quote No&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Version&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;NoOfLines&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;TotalQty&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Status&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;TotalLineValue&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Chris&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;00001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;60&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;O&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;900&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;00002&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;O&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;00003&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;O&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Bob&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;00004&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;I&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using the aggr(), Max() and FirstSortedValue() - which works for the Qty and value but as soon as I drop in the Version Field I get a list of all the versions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2018 15:54:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Max-FirstSorted-Problem/m-p/20647#M3434</guid>
      <dc:creator>chris1987</dc:creator>
      <dc:date>2018-02-27T15:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr / Max / FirstSorted Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Max-FirstSorted-Problem/m-p/20648#M3435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the attached&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/194749_Capture.PNG" style="height: 377px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2018 16:18:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Max-FirstSorted-Problem/m-p/20648#M3435</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-27T16:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr / Max / FirstSorted Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Max-FirstSorted-Problem/m-p/20649#M3436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny, as always you've got the perfect answer! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2018 16:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Max-FirstSorted-Problem/m-p/20649#M3436</guid>
      <dc:creator>chris1987</dc:creator>
      <dc:date>2018-02-27T16:30:08Z</dc:date>
    </item>
  </channel>
</rss>

