<?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: Rank / Max with Set Analysis to Highlight best/ worst in column? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Rank-Max-with-Set-Analysis-to-Highlight-best-worst-in-column/m-p/2472243#M99765</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/180799"&gt;@110&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Try the following:&lt;/P&gt;
&lt;P&gt;Expand your measure, look for &lt;STRONG&gt;Background color expression&lt;/STRONG&gt; and add the following Expression:&lt;/P&gt;
&lt;PRE&gt;If(Rank(Sum(Amount))=1,Green())&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marksouzacosta_0-1721701696407.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169770iCE605D67DE155809/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marksouzacosta_0-1721701696407.png" alt="marksouzacosta_0-1721701696407.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For Set Analysis, you can do something like this:&lt;/P&gt;
&lt;PRE&gt;If(Rank(Sum({&amp;lt;Food = {'Fish'}&amp;gt;} Amount))=1,Green())&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 02:30:55 GMT</pubDate>
    <dc:creator>marksouzacosta</dc:creator>
    <dc:date>2024-07-23T02:30:55Z</dc:date>
    <item>
      <title>Rank / Max with Set Analysis to Highlight best/ worst in column?</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-Max-with-Set-Analysis-to-Highlight-best-worst-in-column/m-p/2472162#M99757</link>
      <description>&lt;P&gt;I've been asked why there's not an option like excel for conditional formatting columns, rows etc. and I don't have a good answer when it comes to set analysis.&lt;BR /&gt;&lt;BR /&gt;Because Rank () won't work where set analysis is used, I'm stumped.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Assuming the below is my data-set&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 192pt;" border="0" width="256" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" span="4" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Name&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt;"&gt;Food&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt;"&gt;Week&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt;"&gt;Amount&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt;"&gt;Bob&lt;/TD&gt;
&lt;TD class="xl66"&gt;Fish&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl67" style="height: 15.0pt;"&gt;Bob&lt;/TD&gt;
&lt;TD class="xl67"&gt;Cheese&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt;"&gt;Bob&lt;/TD&gt;
&lt;TD class="xl66"&gt;Bread&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl67" style="height: 15.0pt;"&gt;Bert&lt;/TD&gt;
&lt;TD class="xl67"&gt;Fish&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt;"&gt;Bert&lt;/TD&gt;
&lt;TD class="xl66"&gt;Cheese&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl67" style="height: 15.0pt;"&gt;Bert&lt;/TD&gt;
&lt;TD class="xl67"&gt;Bread&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt;"&gt;Bob&lt;/TD&gt;
&lt;TD class="xl66"&gt;Fish&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;53&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;9&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl67" style="height: 15.0pt;"&gt;Bob&lt;/TD&gt;
&lt;TD class="xl67"&gt;Cheese&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;53&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt;"&gt;Bob&lt;/TD&gt;
&lt;TD class="xl66"&gt;Bread&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;53&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl67" style="height: 15.0pt;"&gt;Bert&lt;/TD&gt;
&lt;TD class="xl67"&gt;Fish&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;53&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt;"&gt;Bert&lt;/TD&gt;
&lt;TD class="xl66"&gt;Cheese&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;53&lt;/TD&gt;
&lt;TD align="right" class="xl66"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl67" style="height: 15.0pt;"&gt;Bert&lt;/TD&gt;
&lt;TD class="xl67"&gt;Bread&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;53&lt;/TD&gt;
&lt;TD align="right" class="xl67"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;If I added a rule per column&amp;nbsp; to pick the top 1 values and highlight - I'd get something like this ( created with Excel conditional formatting for top 1 )&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110_0-1721661859848.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169746iAE479FCE3D56CAAC/image-size/large?v=v2&amp;amp;px=999" role="button" title="110_0-1721661859848.png" alt="110_0-1721661859848.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using set analysis , so to do the same is to compare the aggregate, but it returns true for both rows&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="110_1-1721662010069.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169747i3DF197C734BF9509/image-size/large?v=v2&amp;amp;px=999" role="button" title="110_1-1721662010069.png" alt="110_1-1721662010069.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(&lt;BR /&gt;Sum( {&amp;lt;Food={"Fish"},[Week]={53}&amp;gt;}Amount)=&lt;/P&gt;
&lt;P&gt;max(aggr(Sum(total &amp;lt;Name&amp;gt; {&amp;lt;Food={"Fish"},[Week]={53}&amp;gt;}Amount),Name)),&lt;BR /&gt;red(),green()&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Are there plans to introduce something simple into table formatting to allow for simpler solutions to this issue?&lt;BR /&gt;&lt;BR /&gt;Like allowing highlighting of top 1, 10, 20 etc, and gradients etc.&amp;nbsp; would be simple to do at a hypercube level , but is a dark art trying to figure out with set analysis.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 15:32:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-Max-with-Set-Analysis-to-Highlight-best-worst-in-column/m-p/2472162#M99757</guid>
      <dc:creator>110</dc:creator>
      <dc:date>2024-07-22T15:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rank / Max with Set Analysis to Highlight best/ worst in column?</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-Max-with-Set-Analysis-to-Highlight-best-worst-in-column/m-p/2472243#M99765</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/180799"&gt;@110&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Try the following:&lt;/P&gt;
&lt;P&gt;Expand your measure, look for &lt;STRONG&gt;Background color expression&lt;/STRONG&gt; and add the following Expression:&lt;/P&gt;
&lt;PRE&gt;If(Rank(Sum(Amount))=1,Green())&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marksouzacosta_0-1721701696407.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169770iCE605D67DE155809/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marksouzacosta_0-1721701696407.png" alt="marksouzacosta_0-1721701696407.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For Set Analysis, you can do something like this:&lt;/P&gt;
&lt;PRE&gt;If(Rank(Sum({&amp;lt;Food = {'Fish'}&amp;gt;} Amount))=1,Green())&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 02:30:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-Max-with-Set-Analysis-to-Highlight-best-worst-in-column/m-p/2472243#M99765</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-07-23T02:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rank / Max with Set Analysis to Highlight best/ worst in column?</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-Max-with-Set-Analysis-to-Highlight-best-worst-in-column/m-p/2472296#M99778</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22035"&gt;@marksouzacosta&lt;/a&gt;&amp;nbsp; &amp;nbsp;- that did it,&amp;nbsp; I'm sure I was initially using a format similar to that, trying to keep it simple, yet I was getting unexpected behaviours - it have have been where I was using a slightly different&amp;nbsp; measure in the rank function, and going down a rabbit hole of trying to match with max/aggr.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;On the plus side, hopefully those searching for Rank() with Set analysis will find a newer post than I did, google seems to find posts exclusively from 2011 or earlier relating to QlikView. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I can confirm this works in 2024 with Qlik SaaS..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 07:45:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-Max-with-Set-Analysis-to-Highlight-best-worst-in-column/m-p/2472296#M99778</guid>
      <dc:creator>110</dc:creator>
      <dc:date>2024-07-23T07:45:04Z</dc:date>
    </item>
  </channel>
</rss>

