<?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 max and group by in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160348#M34656</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Can you explain how do you wanna get the result table then? because I don't understand the approach if you need the max of each Id, by example, for the records ID = 1, if Seg &amp;gt; = 140 and Seg &amp;lt;= 146 then Seg else Max(Seg), how do you get the table result id=1 Final Seg=144 for the three records? 1 - 144, 1 - 260 and 1 - 555?.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Nov 2009 20:26:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-11-20T20:26:35Z</dc:date>
    <item>
      <title>max and group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160344#M34652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have data like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;Id&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;Seg&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;260&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;144&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;555&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;628&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;953&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;876&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;212&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;142&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;123&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Id,&lt;/P&gt;&lt;P&gt;Seg&lt;/P&gt;&lt;P&gt;Resident tab1 group by id;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to achieve the following result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;Id&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;Final Seg&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;144&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;953&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD valign="top" width="55"&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD valign="top" width="156"&gt;&lt;P&gt;142&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;Final Seg = if(Seg &amp;gt;=140 and Seg &amp;lt;=146, Seg, max(Seg))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea is highly appreciated. Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2009 18:12:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160344#M34652</guid>
      <dc:creator />
      <dc:date>2009-11-20T18:12:15Z</dc:date>
    </item>
    <item>
      <title>max and group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160345#M34653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yacine,&lt;/P&gt;&lt;P&gt;Here you are a possible solution.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2009 18:48:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160345#M34653</guid>
      <dc:creator />
      <dc:date>2009-11-20T18:48:53Z</dc:date>
    </item>
    <item>
      <title>max and group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160346#M34654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this expression in ur table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;IF(SEG&amp;gt;=140 AND SEG&amp;lt;=146, SUM(SEG), MAX(SEG))&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Regards,&lt;BR /&gt;Shumail Hussain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2009 19:06:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160346#M34654</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-11-20T19:06:08Z</dc:date>
    </item>
    <item>
      <title>max and group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160347#M34655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your reply. It works but not exactly what I need. I need the max of each Id, not the max of the whole list.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2009 19:58:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160347#M34655</guid>
      <dc:creator />
      <dc:date>2009-11-20T19:58:08Z</dc:date>
    </item>
    <item>
      <title>max and group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160348#M34656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Can you explain how do you wanna get the result table then? because I don't understand the approach if you need the max of each Id, by example, for the records ID = 1, if Seg &amp;gt; = 140 and Seg &amp;lt;= 146 then Seg else Max(Seg), how do you get the table result id=1 Final Seg=144 for the three records? 1 - 144, 1 - 260 and 1 - 555?.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2009 20:26:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160348#M34656</guid>
      <dc:creator />
      <dc:date>2009-11-20T20:26:35Z</dc:date>
    </item>
    <item>
      <title>Re. :Re: max and group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160349#M34657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;for each Id&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;if one of the values (Seg) is in the interval [140 - 146] then&lt;/P&gt;&lt;P style="padding-left:60px;"&gt;finalSeg = Seg&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;else // no Seg value in the interval&lt;/P&gt;&lt;P style="padding-left:60px;"&gt;finalSeg = the max Seg value (for this Id)&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;end&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2009 20:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160349#M34657</guid>
      <dc:creator />
      <dc:date>2009-11-20T20:42:53Z</dc:date>
    </item>
    <item>
      <title>Re. :Re: max and group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160350#M34658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yacine,&lt;/P&gt;&lt;P&gt;Here you are my possible solution.&lt;/P&gt;&lt;P&gt;I hope it works for you.&lt;/P&gt;&lt;P&gt;I have a doubt, ¿what would happen if you found two values in range for the same Id?&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 15:47:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/max-and-group-by-in-script/m-p/160350#M34658</guid>
      <dc:creator />
      <dc:date>2009-11-23T15:47:16Z</dc:date>
    </item>
  </channel>
</rss>

