<?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 How to change value based on Rank in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-change-value-based-on-Rank/m-p/2511770#M105121</link>
    <description>&lt;P&gt;Dear All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a below expression as a measure --&amp;gt; &lt;STRONG&gt;Value Column&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Avg(Aggr(Sum({$&amp;lt;Year=, Month=, Day=,&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Date={"&amp;gt;=$(=date(monthstart(max(Date))))&amp;lt;=$(=date(max(Date)))"}&amp;gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Value),Code, Id)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The above expression generates value,&lt;FONT color="#FF9900"&gt; -2, -1, 0, 1, 2&lt;/FONT&gt; respectively.&lt;/P&gt;&lt;P&gt;Further below is my background expression to highlight top 10.&lt;/P&gt;&lt;P&gt;If(Rank(total Num(Avg(Aggr(Sum({$&amp;lt;Year=, Month=, Day=,&lt;BR /&gt;Date={"&amp;gt;=$(=date(monthstart(max(Date))))&amp;lt;=$(=date(max(Date)))"}&amp;gt;}&lt;BR /&gt;Value),Code, Id),'#,##0%')&amp;lt;=10,'#&lt;FONT color="#00FF00"&gt;3D8D7A&lt;/FONT&gt;')&lt;/P&gt;&lt;P&gt;Requirement:&lt;/P&gt;&lt;P&gt;If the Value column is &lt;U&gt;&lt;STRONG&gt;negative&lt;/STRONG&gt;&lt;/U&gt; and in Top 10 (&lt;EM&gt;Green&lt;/EM&gt;) and the value is -1 or -2, then change it to 2. Refer below sample.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kaushi2020_2-1743050568285.png" style="width: 154px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179022i96B15358C7084659/image-dimensions/154x140?v=v2" width="154" height="140" role="button" title="kaushi2020_2-1743050568285.png" alt="kaushi2020_2-1743050568285.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Mar 2025 04:49:31 GMT</pubDate>
    <dc:creator>Kaushik2020</dc:creator>
    <dc:date>2025-03-27T04:49:31Z</dc:date>
    <item>
      <title>How to change value based on Rank</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-change-value-based-on-Rank/m-p/2511770#M105121</link>
      <description>&lt;P&gt;Dear All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a below expression as a measure --&amp;gt; &lt;STRONG&gt;Value Column&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Avg(Aggr(Sum({$&amp;lt;Year=, Month=, Day=,&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Date={"&amp;gt;=$(=date(monthstart(max(Date))))&amp;lt;=$(=date(max(Date)))"}&amp;gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Value),Code, Id)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The above expression generates value,&lt;FONT color="#FF9900"&gt; -2, -1, 0, 1, 2&lt;/FONT&gt; respectively.&lt;/P&gt;&lt;P&gt;Further below is my background expression to highlight top 10.&lt;/P&gt;&lt;P&gt;If(Rank(total Num(Avg(Aggr(Sum({$&amp;lt;Year=, Month=, Day=,&lt;BR /&gt;Date={"&amp;gt;=$(=date(monthstart(max(Date))))&amp;lt;=$(=date(max(Date)))"}&amp;gt;}&lt;BR /&gt;Value),Code, Id),'#,##0%')&amp;lt;=10,'#&lt;FONT color="#00FF00"&gt;3D8D7A&lt;/FONT&gt;')&lt;/P&gt;&lt;P&gt;Requirement:&lt;/P&gt;&lt;P&gt;If the Value column is &lt;U&gt;&lt;STRONG&gt;negative&lt;/STRONG&gt;&lt;/U&gt; and in Top 10 (&lt;EM&gt;Green&lt;/EM&gt;) and the value is -1 or -2, then change it to 2. Refer below sample.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kaushi2020_2-1743050568285.png" style="width: 154px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179022i96B15358C7084659/image-dimensions/154x140?v=v2" width="154" height="140" role="button" title="kaushi2020_2-1743050568285.png" alt="kaushi2020_2-1743050568285.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 04:49:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-change-value-based-on-Rank/m-p/2511770#M105121</guid>
      <dc:creator>Kaushik2020</dc:creator>
      <dc:date>2025-03-27T04:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value based on Rank</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-change-value-based-on-Rank/m-p/2511837#M105132</link>
      <description>&lt;P&gt;Something like this: if(match([expression1], -1, -2) and [expression2]&amp;lt;=10, 2, [expression1])&lt;/P&gt;&lt;P&gt;So that would be:&lt;/P&gt;&lt;P&gt;if(match( &lt;FONT color="#0000FF"&gt;&lt;EM&gt;Avg(Aggr(Sum({$&amp;lt;Year=, Month=, Day=,&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Date={"&amp;gt;=$(=date(monthstart(max(Date))))&amp;lt;=$(=date(max(Date)))"}&amp;gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Value),Code, Id)&lt;/EM&gt;&lt;/FONT&gt;, -1, -2) and &lt;FONT color="#339966"&gt;&lt;SPAN&gt;Rank(total Num(Avg(Aggr(Sum({$&amp;lt;Year=, Month=, Day=,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;Date={"&amp;gt;=$(=date(monthstart(max(Date))))&amp;lt;=$(=date(max(Date)))"}&amp;gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;Value),Code, Id),'#,##0%')&lt;/SPAN&gt;&lt;/FONT&gt;&amp;lt;=10, 2, &lt;FONT color="#0000FF"&gt;&lt;EM&gt;Avg(Aggr(Sum({$&amp;lt;Year=, Month=, Day=,&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Date={"&amp;gt;=$(=date(monthstart(max(Date))))&amp;lt;=$(=date(max(Date)))"}&amp;gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Value),Code, Id)&lt;/EM&gt;&lt;/FONT&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 09:39:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-change-value-based-on-Rank/m-p/2511837#M105132</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2025-03-27T09:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value based on Rank</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-change-value-based-on-Rank/m-p/2512342#M105199</link>
      <description>&lt;P&gt;And you could probably shorten the expression by moving the set expression outside:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#CC99FF"&gt;{$&amp;lt;Year=, Month=, Day=,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color="#CC99FF"&gt;Date={"&amp;gt;=$(=date(monthstart(max(Date))))&amp;lt;=$(=date(max(Date)))"}&amp;gt;}&lt;/FONT&gt; if(match( Avg(Aggr(Sum(&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;Value),Code, Id), -1, -2) and Rank(total Num(Avg(Aggr(Sum(Value),Code, Id),'#,##0%')&amp;lt;=10, 2, Avg(Aggr(Sum(Value),Code, Id))&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 12:59:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-change-value-based-on-Rank/m-p/2512342#M105199</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2025-03-31T12:59:26Z</dc:date>
    </item>
  </channel>
</rss>

