<?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 Searching for the right formula in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Searching-for-the-right-formula/m-p/493387#M184556</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is a rather trivial question: I am looking for the formula to do a certain thing, but the name I have in mind is not the same in QlikView and I just don't find it:&lt;/P&gt;&lt;P&gt;- To set the status_lights on the diagrams in my apps (red/ green), I calculate something to compare with a target_value, sometimes&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rather complex (usually the avg of the past week vs. a fixed value, sometimes a fixed value vs. a calculated target)&lt;/P&gt;&lt;P&gt;=&amp;gt; Now I want to include a third status, "yellow", in the status_lights. Then I will have the following logic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Value on target (above or below target_value, depending...) -&amp;gt; green&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Value within 5% of target -&amp;gt; yellow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Value missed target by more than 5% -&amp;gt; red&lt;/P&gt;&lt;P&gt;The thing is: Currently, I calculate the middle status, "yellow", by using an IF-condition with two arguments:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; value&amp;gt;target AND value&amp;lt;=(target*1.05) &amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;=&amp;gt; I'm sure there is some way to do that in a more elegant way, but I just can't find the right formula.&lt;/P&gt;&lt;P&gt;Can someone tell me what that would be? (Sth. like "BETWEEN")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Sep 2013 12:22:56 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2013-09-30T12:22:56Z</dc:date>
    <item>
      <title>Searching for the right formula</title>
      <link>https://community.qlik.com/t5/QlikView/Searching-for-the-right-formula/m-p/493387#M184556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is a rather trivial question: I am looking for the formula to do a certain thing, but the name I have in mind is not the same in QlikView and I just don't find it:&lt;/P&gt;&lt;P&gt;- To set the status_lights on the diagrams in my apps (red/ green), I calculate something to compare with a target_value, sometimes&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rather complex (usually the avg of the past week vs. a fixed value, sometimes a fixed value vs. a calculated target)&lt;/P&gt;&lt;P&gt;=&amp;gt; Now I want to include a third status, "yellow", in the status_lights. Then I will have the following logic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Value on target (above or below target_value, depending...) -&amp;gt; green&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Value within 5% of target -&amp;gt; yellow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Value missed target by more than 5% -&amp;gt; red&lt;/P&gt;&lt;P&gt;The thing is: Currently, I calculate the middle status, "yellow", by using an IF-condition with two arguments:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; value&amp;gt;target AND value&amp;lt;=(target*1.05) &amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;=&amp;gt; I'm sure there is some way to do that in a more elegant way, but I just can't find the right formula.&lt;/P&gt;&lt;P&gt;Can someone tell me what that would be? (Sth. like "BETWEEN")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 12:22:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Searching-for-the-right-formula/m-p/493387#M184556</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-09-30T12:22:56Z</dc:date>
    </item>
  </channel>
</rss>

