<?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 use colormix2 if lowest number is 0 in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-use-colormix2-if-lowest-number-is-0/m-p/2511047#M104993</link>
    <description>&lt;P&gt;Hi all.&lt;BR /&gt;Could someone please advise how to adjust the Rank part for&amp;nbsp;colormix2 () to have a gradient starting from 0, not -1?&amp;nbsp;In this case, 0 is the smallest possible number and should be perceived by the function as -1, that is, be in red.&lt;BR /&gt;&lt;BR /&gt;I don't use&amp;nbsp;colormix1 because colours from red to green should go through white colour.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My current results and expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;=Colormix2 ((Rank(total Sum (Velocity_Sales)))/(NoOfRows(Total)/2), Red(), Green(), white())&lt;/P&gt;&lt;P&gt;&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="Peony_0-1742587380600.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/178870i5F4424C8A8662BCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Peony_0-1742587380600.png" alt="Peony_0-1742587380600.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Mar 2025 20:07:19 GMT</pubDate>
    <dc:creator>Peony</dc:creator>
    <dc:date>2025-03-21T20:07:19Z</dc:date>
    <item>
      <title>How to use colormix2 if lowest number is 0</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-use-colormix2-if-lowest-number-is-0/m-p/2511047#M104993</link>
      <description>&lt;P&gt;Hi all.&lt;BR /&gt;Could someone please advise how to adjust the Rank part for&amp;nbsp;colormix2 () to have a gradient starting from 0, not -1?&amp;nbsp;In this case, 0 is the smallest possible number and should be perceived by the function as -1, that is, be in red.&lt;BR /&gt;&lt;BR /&gt;I don't use&amp;nbsp;colormix1 because colours from red to green should go through white colour.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My current results and expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;=Colormix2 ((Rank(total Sum (Velocity_Sales)))/(NoOfRows(Total)/2), Red(), Green(), white())&lt;/P&gt;&lt;P&gt;&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="Peony_0-1742587380600.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/178870i5F4424C8A8662BCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Peony_0-1742587380600.png" alt="Peony_0-1742587380600.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 20:07:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-use-colormix2-if-lowest-number-is-0/m-p/2511047#M104993</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2025-03-21T20:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use colormix2 if lowest number is 0</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-use-colormix2-if-lowest-number-is-0/m-p/2511058#M104994</link>
      <description>&lt;P&gt;Hi, the default formula to convert values to another range is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(value - min_value) / (max_value - min_value) * (max_range_value - min_range_value) + min_range_value&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;For a -1 to 1 range it's the same as:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;((value - min_value) / (max_value - min_value) * 2) - 1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If you set a predefined range where all values below that range is red, and above is green, it simplifies a lot the calculation, as min_value and max_value will be converted to that fixed numbers.&lt;/P&gt;&lt;P&gt;If you want to get the max a min values you have as the range, the you need to calculated them first to apply them on the formula, just note that in that case, selections can change colors, one value could be white, but if selections changes the values shown, that white could be converted to red or green depending on the new values filtered.&lt;/P&gt;&lt;P&gt;You can also calculate the min and max values on script, and set those values in variables, so you can use them as fixed values.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Mar 2025 08:08:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-use-colormix2-if-lowest-number-is-0/m-p/2511058#M104994</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2025-03-22T08:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use colormix2 if lowest number is 0</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-use-colormix2-if-lowest-number-is-0/m-p/2514694#M105557</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;&amp;nbsp;thank you much&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 10:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-use-colormix2-if-lowest-number-is-0/m-p/2514694#M105557</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2025-04-17T10:19:01Z</dc:date>
    </item>
  </channel>
</rss>

