<?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 function used in Line chart for coloring TOP 10 values in last 7 days time (for given Date) in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140663#M92748</link>
    <description>&lt;P&gt;Thank you for reply,&lt;BR /&gt;&lt;BR /&gt;This is my outcome when I use this function:&lt;BR /&gt;if(Rank(count({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;} Total&amp;lt;PRODUCT&amp;gt;))=1,RGB(106, 94, 166) ...&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="MATC_0-1700725643006.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120476iE1A27CA0B944D68E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MATC_0-1700725643006.png" alt="MATC_0-1700725643006.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;without total in count i get this&lt;BR /&gt;if(Rank(count({&amp;lt;Date = {"$(vMaxxDate)"}&amp;gt;} PRODUCT))=1,RGB(106, 94, 166) ...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MATC_1-1700725714959.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120477iCC4D293AC5F444F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MATC_1-1700725714959.png" alt="MATC_1-1700725714959.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Nov 2023 07:49:13 GMT</pubDate>
    <dc:creator>MATC</dc:creator>
    <dc:date>2023-11-23T07:49:13Z</dc:date>
    <item>
      <title>Rank function used in Line chart for coloring TOP 10 values in last 7 days time (for given Date)</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140371#M92723</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've created the Top 10 functionality using Rank function in table. Similarly I've created line chart using similar function.&lt;BR /&gt;I've set coloring to table to reflect 1-10 position and would like to set identical colors throughout line chart.&lt;/P&gt;
&lt;P&gt;Line chart represents last 7 days for the top 10 positions from today (Value that is in Top 10 today might not be in top 10 yesterday) And Top's interchange between those days as well.&amp;nbsp;&lt;BR /&gt;Issue is that I can't freeze the top 1 -10 values from today in the whole last 7 days&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Function that I'm using is for coloring :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MATC_0-1700663760411.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120415iE6A460848E625250/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MATC_0-1700663760411.png" alt="MATC_0-1700663760411.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In 2023-07-08 TOP 1 value switches color with TOP 2 value - (top 1 and 2 for 2023-07-10) as the TOP 2 is in 1st position for 2023-07-08 but i need to make the color consistent with the 2023-07-10 data&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if(Rank(count({&amp;lt;Date = {"$(=date(Max(Date)))"},Date_&amp;gt;} VALUE1))=1,RGB(106, 94, 166) ...&lt;BR /&gt;- I need to "Freeze" the date as I think that in line chart every dimension value is itself the maxdate that is available. Is there a possibility for that?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've also achieved that only the today's date is colored and the rest is gray.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(rank(count({&amp;lt;Date = {"$(=date(max(TOTAL Date)))"}&amp;gt;} VALUE))=1,RGB(106, 94, 166)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 14:41:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140371#M92723</guid>
      <dc:creator>MATC</dc:creator>
      <dc:date>2023-11-22T14:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function used in Line chart for coloring TOP 10 values in last 7 days time (for given Date)</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140386#M92725</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'd suggest two improvements here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. You should add the TOTAL qualifier to your count function - that will allow you to disregard the Date dimension and always get the count for the current date - something like this (assuming that the second dimension is called Product):&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if(Rank(count({&amp;lt;Date = {"$(=date(Max(Date)))"}&amp;gt;}&amp;nbsp;&lt;STRONG&gt; TOTAL &amp;lt;Product&amp;gt;&amp;nbsp;&lt;/STRONG&gt; VALUE1))=1,RGB(106, 94, 166) ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. Since the date(Max(Date)) represents today's date, or the highest selected date, it could be calculated outside of the chart, eliminating any guesswork. For example, you could add a variable vMaxDate and calculate it ahead of time:&lt;BR /&gt;&lt;BR /&gt;The definition of vMaxDate should read "(=date(Max(Date))", and then the Set Analysis would look like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if(Rank(count({&amp;lt;Date = {"&lt;STRONG&gt;$(vMaxDate )&lt;/STRONG&gt;"}&amp;gt;}&amp;nbsp;&lt;STRONG&gt; TOTAL &amp;lt;Product&amp;gt;&amp;nbsp;&lt;/STRONG&gt; VALUE1))=1,RGB(106, 94, 166) ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 14:51:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140386#M92725</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-11-22T14:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function used in Line chart for coloring TOP 10 values in last 7 days time (for given Date)</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140396#M92726</link>
      <description>&lt;P&gt;Thanks for replying,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1st solution is not working - It grays out the line - I've played around with TOTAL qualifiers already. Adding the Total qualifier to Max aggregation in date grays out last 6 days and only colors the "today's" date&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MATC_4-1700665143108.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120420iF1A82FEDF6F8CBFD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MATC_4-1700665143108.png" alt="MATC_4-1700665143108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2nd solution won't work for me as the end user can select different dates in time so for example last month's date will be represented as "today's" - max(date).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 14:59:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140396#M92726</guid>
      <dc:creator>MATC</dc:creator>
      <dc:date>2023-11-22T14:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function used in Line chart for coloring TOP 10 values in last 7 days time (for given Date)</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140443#M92729</link>
      <description>&lt;P&gt;I don't think you understood my suggestions at all:&lt;/P&gt;
&lt;P&gt;- you played with the TOTAL in the max() function, while you need to have TOTAL in the Count()&lt;/P&gt;
&lt;P&gt;- A variable with the formula that begins with an equals sign gets recalculated with each user selection, so it should fit your needs perfectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 16:00:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140443#M92729</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-11-22T16:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function used in Line chart for coloring TOP 10 values in last 7 days time (for given Date)</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140663#M92748</link>
      <description>&lt;P&gt;Thank you for reply,&lt;BR /&gt;&lt;BR /&gt;This is my outcome when I use this function:&lt;BR /&gt;if(Rank(count({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;} Total&amp;lt;PRODUCT&amp;gt;))=1,RGB(106, 94, 166) ...&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="MATC_0-1700725643006.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120476iE1A27CA0B944D68E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MATC_0-1700725643006.png" alt="MATC_0-1700725643006.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;without total in count i get this&lt;BR /&gt;if(Rank(count({&amp;lt;Date = {"$(vMaxxDate)"}&amp;gt;} PRODUCT))=1,RGB(106, 94, 166) ...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MATC_1-1700725714959.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120477iCC4D293AC5F444F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MATC_1-1700725714959.png" alt="MATC_1-1700725714959.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 07:49:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2140663#M92748</guid>
      <dc:creator>MATC</dc:creator>
      <dc:date>2023-11-23T07:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function used in Line chart for coloring TOP 10 values in last 7 days time (for given Date)</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2142014#M92899</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;In your first formula, you lost the field&amp;nbsp; that you were counting (used to be VALUE1) - you have Set Analysis and the TOTAL &amp;lt;PRODUCT&amp;gt; but no field to count. You should be getting a syntax error on it.&lt;/P&gt;
&lt;P&gt;In your second formula, since it doesn't have a TOTAL qualifier, it can only be true for the current date, hence the coloring of the current date only.&lt;/P&gt;
&lt;P&gt;I believe that the first formula, after you fix the syntax error in it, should give you the desired result.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 14:44:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2142014#M92899</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-11-28T14:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rank function used in Line chart for coloring TOP 10 values in last 7 days time (for given Date)</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2142033#M92900</link>
      <description>&lt;P&gt;Thank you Oleg, indeed i forgot to add the correct dimension after the total quantifier. It is working now thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 15:00:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-function-used-in-Line-chart-for-coloring-TOP-10-values-in/m-p/2142033#M92900</guid>
      <dc:creator>MATC</dc:creator>
      <dc:date>2023-11-28T15:00:33Z</dc:date>
    </item>
  </channel>
</rss>

