<?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 Group by question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Group-by-question/m-p/367215#M704496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the thing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imaging that I have this fields:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="320"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="80"&gt;Group&lt;/TD&gt;&lt;TD width="80"&gt;Category&lt;/TD&gt;&lt;TD width="80"&gt;Date&lt;/TD&gt;&lt;TD width="80"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to calculate the max(Amount) and get the date of that maximum grouping by Group and Category.&lt;/P&gt;&lt;P&gt;And this is the problem:&lt;/P&gt;&lt;P&gt;If I do the group by with Group and Category, I don´t know in which date I had the maximum, the solution I thought is doing a link with the amount or with a key composed by&amp;nbsp; Group&amp;amp;Category&amp;amp;Amount but I don´t think it would be the best solution, overall if there are repetead maximums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I can´t group by Group, Category and Date, because I want the maximum amount of those Dates and not the maximum per day.&lt;/P&gt;&lt;P&gt;The date must be only an added information field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If is not clear enough, ask me please.&lt;/P&gt;&lt;P&gt;I´m doing all in the load script, FYI.&lt;/P&gt;&lt;P&gt;Any ideas??&lt;/P&gt;&lt;P&gt;Thank´s&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jun 2012 18:25:03 GMT</pubDate>
    <dc:creator>chematos</dc:creator>
    <dc:date>2012-06-25T18:25:03Z</dc:date>
    <item>
      <title>Group by question</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-question/m-p/367215#M704496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the thing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imaging that I have this fields:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="320"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="80"&gt;Group&lt;/TD&gt;&lt;TD width="80"&gt;Category&lt;/TD&gt;&lt;TD width="80"&gt;Date&lt;/TD&gt;&lt;TD width="80"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to calculate the max(Amount) and get the date of that maximum grouping by Group and Category.&lt;/P&gt;&lt;P&gt;And this is the problem:&lt;/P&gt;&lt;P&gt;If I do the group by with Group and Category, I don´t know in which date I had the maximum, the solution I thought is doing a link with the amount or with a key composed by&amp;nbsp; Group&amp;amp;Category&amp;amp;Amount but I don´t think it would be the best solution, overall if there are repetead maximums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I can´t group by Group, Category and Date, because I want the maximum amount of those Dates and not the maximum per day.&lt;/P&gt;&lt;P&gt;The date must be only an added information field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If is not clear enough, ask me please.&lt;/P&gt;&lt;P&gt;I´m doing all in the load script, FYI.&lt;/P&gt;&lt;P&gt;Any ideas??&lt;/P&gt;&lt;P&gt;Thank´s&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 18:25:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-question/m-p/367215#M704496</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-06-25T18:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Group by question</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-question/m-p/367216#M704497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have only one Amount record per Date, Category and Group or do you need to sum amounts prior getting the max?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you could try using max(Amount) and FirstSortedValue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Group,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Category,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;max(Amount) as MaxAmount,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FirstSortedValue(Distinct Date, -Amount) as MaxAmountDate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resident YourTable group by Group, Category;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 18:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-question/m-p/367216#M704497</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-06-25T18:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Group by question</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-question/m-p/367217#M704498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As successful as ever! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Thank you, it´s a great function this FirstSortedValue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 19:28:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-question/m-p/367217#M704498</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-06-25T19:28:16Z</dc:date>
    </item>
  </channel>
</rss>

