<?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: Multiple If statements not returning correct result in Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1956149#M1219919</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;First thanks for reply&lt;/P&gt;
&lt;P&gt;I am looking at adjusting our MaxQty number if it does not fall between the 2 Sales Numbers&lt;/P&gt;
&lt;P&gt;ID 1 the MaxQty is 10 the&amp;nbsp; measures 15.5 is the Under and the 43.3 is Over&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the&amp;nbsp; MaxQty should fall between these 2 numbers&amp;nbsp; = Okay&lt;/P&gt;
&lt;P&gt;if in this case the MaxQty 10&amp;nbsp; is&amp;nbsp; Under&amp;nbsp; 15.5&amp;nbsp; which then = Under&lt;/P&gt;
&lt;P&gt;if the MaxQty is 50 then it is = Over&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID 4 should = Okay&lt;/P&gt;
&lt;P&gt;sorry , I hope this explains it better&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards Peter&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 21:21:11 GMT</pubDate>
    <dc:creator>Peter_Brunner</dc:creator>
    <dc:date>2022-07-14T21:21:11Z</dc:date>
    <item>
      <title>Multiple If statements not returning correct result in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1955535#M1219895</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I am getting erratic results as I have been trying to get an Expression with multi If statements running to return correct labels to what a Maximum Qty is to a Formula.&amp;nbsp; I am not sure if there is another way to handle this as there is no between function in Qlikview&lt;/P&gt;
&lt;P&gt;I have attached a small sample with my structure&amp;nbsp; basically the if statements have to return 4 labels&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'IF (MaxQty&amp;gt;=(SALES*1.4),"MAX OVER",IF(MaxQty&amp;lt;(SALES*0.5),"MAX UNDER", "OKAY")&amp;nbsp; else if error&amp;nbsp; "MAX_CHECK"&lt;/P&gt;
&lt;P&gt;the Variables 1.4 and .5 to create a buffer for MaxQty to fall between.&lt;/P&gt;
&lt;P&gt;any Help Much Appreciated&lt;/P&gt;
&lt;P&gt;regards Peter&lt;/P&gt;
&lt;P&gt;I&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 05:00:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1955535#M1219895</guid>
      <dc:creator>Peter_Brunner</dc:creator>
      <dc:date>2022-07-14T05:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple If statements not returning correct result in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1955925#M1219912</link>
      <description>&lt;P&gt;Your sample data and expected output doesn't seem to match your formula.&lt;/P&gt;
&lt;P&gt;For ID1, MaxQty is 10, Sales*vMaxUnder/vAveMth is 15.5&lt;/P&gt;
&lt;P&gt;15.5 is not less than 10, so this should not return MAX_UNDER as per Sales*vMaxUnder/vAveMth &amp;lt; MaxQty&lt;/P&gt;
&lt;P&gt;For ID4, MaxQty is 2, Sales*vMaxUnder/vAveMth is 1&lt;/P&gt;
&lt;P&gt;1 is not greater than 2, so this is not OKAY as per Sales*vMaxUnder/vAveMth &amp;gt;MaxQty&lt;/P&gt;
&lt;P&gt;You should be able to basically use the formula you posted here, replacing the hard coded figures with the variables, except I'm not sure what "if error" is supposed to mean as there is no possible error here - all values are caught in one of the three existing outcomes. &lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 14:03:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1955925#M1219912</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-07-14T14:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple If statements not returning correct result in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1956149#M1219919</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;First thanks for reply&lt;/P&gt;
&lt;P&gt;I am looking at adjusting our MaxQty number if it does not fall between the 2 Sales Numbers&lt;/P&gt;
&lt;P&gt;ID 1 the MaxQty is 10 the&amp;nbsp; measures 15.5 is the Under and the 43.3 is Over&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the&amp;nbsp; MaxQty should fall between these 2 numbers&amp;nbsp; = Okay&lt;/P&gt;
&lt;P&gt;if in this case the MaxQty 10&amp;nbsp; is&amp;nbsp; Under&amp;nbsp; 15.5&amp;nbsp; which then = Under&lt;/P&gt;
&lt;P&gt;if the MaxQty is 50 then it is = Over&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID 4 should = Okay&lt;/P&gt;
&lt;P&gt;sorry , I hope this explains it better&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards Peter&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 21:21:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1956149#M1219919</guid>
      <dc:creator>Peter_Brunner</dc:creator>
      <dc:date>2022-07-14T21:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple If statements not returning correct result in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1956222#M1219922</link>
      <description>&lt;P&gt;I have found the solution see attached file it seems there is a certain order the if statements must be to get correct results&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards Peter&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 05:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-If-statements-not-returning-correct-result-in/m-p/1956222#M1219922</guid>
      <dc:creator>Peter_Brunner</dc:creator>
      <dc:date>2022-07-15T05:33:18Z</dc:date>
    </item>
  </channel>
</rss>

