<?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: Obtain field with maximum value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256867#M623562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arpit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this,Its working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category&lt;/SPAN&gt;&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category&lt;/SPAN&gt;,-Aggr(max({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category&lt;/SPAN&gt;&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Value&lt;/SPAN&gt;),&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;By using this you can achieve Category B as the answer even if you made the selection on &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Category it won't change&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;--Surendra&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jan 2017 14:59:05 GMT</pubDate>
    <dc:creator>surendraj</dc:creator>
    <dc:date>2017-01-02T14:59:05Z</dc:date>
    <item>
      <title>Obtain field with maximum value</title>
      <link>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256862#M623552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please consider the following example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid #000000; border-image: none; width: 58px; height: 68px;" width="102"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Category&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;22%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be loading the above table directly into Qlik. What I want is to first have an average of Value so that the following table is obtained:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="74" style="border: 1px solid rgb(0, 0, 0); border-image: none; width: 103px; height: 33px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Category&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;15%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;21%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from this now I have to find the name of the category having the highest value. So, from table1 I have to obtain Category B as the answer.&lt;/P&gt;&lt;P&gt;How to perform the above using Set Analysis or/and Back-end scripting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 08:28:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256862#M623552</guid>
      <dc:creator>arpitkharkia</dc:creator>
      <dc:date>2017-01-02T08:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain field with maximum value</title>
      <link>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256863#M623554</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 finding the Category with the highest avg &lt;/P&gt;&lt;P&gt;use this expression :&lt;/P&gt;&lt;P&gt;=FirstSortedValue(&lt;SPAN style="font-size: 13.3333px;"&gt;Category&lt;/SPAN&gt;,-aggr(avg(Value),&lt;SPAN style="font-size: 13.3333px;"&gt;Category&lt;/SPAN&gt;))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 08:42:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256863#M623554</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2017-01-02T08:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain field with maximum value</title>
      <link>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256864#M623557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why can't you create Simple&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Num(Avg(Value),'##,##0%')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="148073" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/148073_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For second one try like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For Max =FirstSortedValue(Category,Aggr(Num(Avg(Value),'##,##0%'),Category))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For Min &lt;STRONG style="font-size: 13.3333px;"&gt;=FirstSortedValue(Category,&lt;SPAN style="color: #ff0000;"&gt;-&lt;/SPAN&gt;Aggr(Num(Avg(Value),'##,##0%'),Category))&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 09:21:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256864#M623557</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-01-02T09:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain field with maximum value</title>
      <link>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256865#M623559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14833491303629608" jivemacro_uid="_14833491303629608"&gt;
&lt;P&gt;=Num(rangeavg(Aggr(Above(sum(Value),0,rowno()),Category))/Count(Category),'#,##0%')&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Exression in chart&amp;nbsp; or Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Hirish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 09:24:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256865#M623559</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2017-01-02T09:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain field with maximum value</title>
      <link>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256866#M623561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=FirstSortedValue(Distinct Category,-Aggr(Avg(Value),Category))&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;=FirstSortedValue(Category,-Aggr(Avg(Value),Category))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you have more than one category having same average.. you can use below to get more than one category..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Concat({&amp;lt;Category = {"=Rank(Avg(Value))=1"}&amp;gt;}DISTINCT Category)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 10:09:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256866#M623561</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2017-01-02T10:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain field with maximum value</title>
      <link>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256867#M623562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arpit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this,Its working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category&lt;/SPAN&gt;&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category&lt;/SPAN&gt;,-Aggr(max({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category&lt;/SPAN&gt;&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Value&lt;/SPAN&gt;),&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;By using this you can achieve Category B as the answer even if you made the selection on &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Category it won't change&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;--Surendra&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 14:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256867#M623562</guid>
      <dc:creator>surendraj</dc:creator>
      <dc:date>2017-01-02T14:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain field with maximum value</title>
      <link>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256868#M623563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you everyone for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2017 05:38:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Obtain-field-with-maximum-value/m-p/1256868#M623563</guid>
      <dc:creator>arpitkharkia</dc:creator>
      <dc:date>2017-01-04T05:38:59Z</dc:date>
    </item>
  </channel>
</rss>

