<?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: Using If statements to set colors in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778221#M60426</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;you have to set between ranges as below&lt;/P&gt;&lt;P&gt;If(Avg(Targets)- Avg([Sales])) &amp;gt;= 10 and (Avg(Targets)- Avg([Sales])) &amp;lt;= 15, Yellow(),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ksrinivasan&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jan 2021 18:35:08 GMT</pubDate>
    <dc:creator>Ksrinivasan</dc:creator>
    <dc:date>2021-01-28T18:35:08Z</dc:date>
    <item>
      <title>Using If statements to set colors</title>
      <link>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778214#M60424</link>
      <description>&lt;P&gt;I am trying to set colors of the bars based on the difference between target and actual sales. but the problem I am having is that if the difference is exactly 5, the color will be blue otherwise it will show gray. even though the code says&amp;nbsp; if (Avg(Targets)- (Avg([Sales])) &amp;gt;= 5, then set blue as the color. it only show blue when the difference is EXACLTY 5. how do i fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=If(Avg(Targets)- (Avg([Sales])) &amp;gt;= 10, Yellow(),&lt;/P&gt;&lt;P&gt;If(Avg(Targets)- (Avg([Sales])) &amp;gt;= 15, Red(),&lt;/P&gt;&lt;P&gt;If(Avg(Targets)- (Avg([Sales])) &amp;gt;= 5, LightBlue(),&lt;/P&gt;&lt;P&gt;)))&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:33:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778214#M60424</guid>
      <dc:creator>Mch201</dc:creator>
      <dc:date>2024-11-16T17:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using If statements to set colors</title>
      <link>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778220#M60425</link>
      <description>&lt;P&gt;average will result in a real number and not an integer and depending on how you display your data (Qlik Sense rounds it off) so depending on your precision, add fraction to force it to round up in your if statement.&amp;nbsp; you will need to test this fraction (format your expression to show more decimal points so you know what you are dealing with)&lt;BR /&gt;&lt;BR /&gt;also test for &amp;gt;=15 before testing for &amp;gt;=10 as it is Red will never show&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 18:32:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778220#M60425</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-01-28T18:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using If statements to set colors</title>
      <link>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778221#M60426</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;you have to set between ranges as below&lt;/P&gt;&lt;P&gt;If(Avg(Targets)- Avg([Sales])) &amp;gt;= 10 and (Avg(Targets)- Avg([Sales])) &amp;lt;= 15, Yellow(),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ksrinivasan&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 18:35:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778221#M60426</guid>
      <dc:creator>Ksrinivasan</dc:creator>
      <dc:date>2021-01-28T18:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using If statements to set colors</title>
      <link>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778229#M60429</link>
      <description>&lt;P&gt;Use Below Code for reference..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;if( $(vActual) &amp;gt;=15 ,Red()
    ,if( $(vActual) &amp;gt;=10 ,Yellow()
        ,if( $(vActual) &amp;gt;= 5 ,blue()
            ,Black()	// for all values less than 5
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where vActual is variable holding calculation condition&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Avg(Targets)- Avg(Sales)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/58578"&gt;@edwin&lt;/a&gt;&amp;nbsp; is right! Be aware of the code execution flow.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 19:12:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-If-statements-to-set-colors/m-p/1778229#M60429</guid>
      <dc:creator>PradeepK</dc:creator>
      <dc:date>2021-01-28T19:12:45Z</dc:date>
    </item>
  </channel>
</rss>

