<?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 Cannot compare max value of a dimension and the inline value of the dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109570#M90612</link>
    <description>&lt;P&gt;i created a simple table to test what doesnt work on my app, let's say&lt;/P&gt;
&lt;P&gt;Table:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;clientID , clientreport&lt;BR /&gt;123 , 2&lt;BR /&gt;123 , 4&lt;BR /&gt;145 , 1&lt;BR /&gt;145 , 3&lt;BR /&gt;89 , 9&lt;BR /&gt;89 , 11&lt;BR /&gt;89 , 6&lt;BR /&gt;200 , 22&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;now, i cannot work to make this formula: '&amp;nbsp;&lt;EM&gt;clientreport = aggr(max(clientreport),clientID)&amp;nbsp;&lt;/EM&gt;', since when I use max of the dimension then in all rows the max value disappears except the second-max one.&lt;/P&gt;
&lt;P&gt;When the clientID is single row, it works tough.&lt;/P&gt;
&lt;P&gt;You can see it using strings instead of values, as in '&amp;nbsp;&lt;EM&gt;=clientreport &amp;amp; '=' &amp;amp; aggr(max(clientreport),clientID)&amp;nbsp;&lt;/EM&gt;'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 557px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/115122iD5B1947A95AD0653/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;formula&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;clientreport = aggr(max(clientreport),clientID)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;string&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;clientreport &amp;amp; '=' &amp;amp; aggr(max(clientreport),clientID)&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2023 14:42:05 GMT</pubDate>
    <dc:creator>serpentium</dc:creator>
    <dc:date>2023-08-24T14:42:05Z</dc:date>
    <item>
      <title>Cannot compare max value of a dimension and the inline value of the dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109570#M90612</link>
      <description>&lt;P&gt;i created a simple table to test what doesnt work on my app, let's say&lt;/P&gt;
&lt;P&gt;Table:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;clientID , clientreport&lt;BR /&gt;123 , 2&lt;BR /&gt;123 , 4&lt;BR /&gt;145 , 1&lt;BR /&gt;145 , 3&lt;BR /&gt;89 , 9&lt;BR /&gt;89 , 11&lt;BR /&gt;89 , 6&lt;BR /&gt;200 , 22&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;now, i cannot work to make this formula: '&amp;nbsp;&lt;EM&gt;clientreport = aggr(max(clientreport),clientID)&amp;nbsp;&lt;/EM&gt;', since when I use max of the dimension then in all rows the max value disappears except the second-max one.&lt;/P&gt;
&lt;P&gt;When the clientID is single row, it works tough.&lt;/P&gt;
&lt;P&gt;You can see it using strings instead of values, as in '&amp;nbsp;&lt;EM&gt;=clientreport &amp;amp; '=' &amp;amp; aggr(max(clientreport),clientID)&amp;nbsp;&lt;/EM&gt;'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 557px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/115122iD5B1947A95AD0653/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;formula&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;clientreport = aggr(max(clientreport),clientID)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;string&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;clientreport &amp;amp; '=' &amp;amp; aggr(max(clientreport),clientID)&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:42:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109570#M90612</guid>
      <dc:creator>serpentium</dc:creator>
      <dc:date>2023-08-24T14:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot compare max value of a dimension and the inline value of the dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109582#M90614</link>
      <description>&lt;P&gt;Use nodistinct to show Max value in each row, like this -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;aggr(&lt;STRONG&gt;nodistinct&lt;/STRONG&gt; max(clientreport),clientID)&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:59:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109582#M90614</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2023-08-24T14:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot compare max value of a dimension and the inline value of the dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109585#M90616</link>
      <description>&lt;P&gt;i cannot believe i lost two days working on it, and it was this simple.&lt;/P&gt;
&lt;P&gt;you are lifesaver, thank you so much!!!!!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 15:01:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109585#M90616</guid>
      <dc:creator>serpentium</dc:creator>
      <dc:date>2023-08-24T15:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot compare max value of a dimension and the inline value of the dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109590#M90617</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Digvijay_Singh_0-1692889415141.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/115126i386E6947DC01BDF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Digvijay_Singh_0-1692889415141.png" alt="Digvijay_Singh_0-1692889415141.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 15:04:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109590#M90617</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2023-08-24T15:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot compare max value of a dimension and the inline value of the dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109651#M90623</link>
      <description>&lt;P&gt;Sorry I was late to this party... Just to add my 2 cents - in addition to the NODISTINCT, there are a few more things to keep in mind here:&lt;/P&gt;
&lt;P&gt;- the AGGR() function returns an array of values, rather than a single value, which means that in certain situations, you may get a NULL as a result, because you would be comparing a single value with an array of values. In this particular case, since the AGGR returns one max value per clientID, which is also a dimension, it happens to work as expected.&lt;/P&gt;
&lt;P&gt;- For a calculation like this, where you essentially need a total by one of the chart dimensions, I'd recommend simply using a TOTAL qualifier as a better option - it works more consistently, with less quirks, and it would perform a lot better than AGGR, which would be substantial on a large data set. So, the preferred formula would be:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;clientreport = max( TOTAL &amp;lt;clientID&amp;gt; clientreport)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;This is one of the examples that I teach at my lecture on Set Analysis and AGGR() at the &lt;A href="https://masterssummit.com" target="_blank" rel="noopener"&gt;Masters Summit for Qlik&lt;/A&gt;. We will be in Orlando and in Dublin this fall - check out our agenda and see if you can join. You will learn a lot of new advanced material from some of the best experts in the world!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 18:13:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109651#M90623</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-08-24T18:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot compare max value of a dimension and the inline value of the dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109662#M90625</link>
      <description>&lt;P&gt;Max + total it's interesting idea, but doesn't work as dimension, works as measure, isn't it?&lt;/P&gt;
&lt;P&gt;with dimension i can use a null() result and hide them&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 18:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cannot-compare-max-value-of-a-dimension-and-the-inline-value-of/m-p/2109662#M90625</guid>
      <dc:creator>serpentium</dc:creator>
      <dc:date>2023-08-24T18:44:08Z</dc:date>
    </item>
  </channel>
</rss>

