<?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: Help With Complex &amp;quot;If ElseIF ElseIF&amp;quot; Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320034#M615574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Anil, that was the exact answer! I think when I was asking the question I was overthinking it but you hit the nail right on the head. My exact code looked like the below in the end FYI for anyone this may help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isNull(YArrangment.Threshold2) OR $(CollectiveSPNRev) &amp;lt; YArrangment.Threshold2 , YArrangment.Rebate1 , if(isNull(YArrangment.Threshold3) OR $(CollectiveSPNRev) &amp;lt; YArrangment.Threshold3 , YArrangment.Rebate2, if(isNull(YArrangment.Threshold4) OR $(CollectiveSPNRev) &amp;lt; YArrangment.Threshold4 , YArrangment.Rebate3, if(IsNull(YArrangment.Rebate4), YArrangment.Rebate3, YArrangment.Rebate4))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jul 2017 09:22:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-18T09:22:31Z</dc:date>
    <item>
      <title>Help With Complex "If ElseIF ElseIF" Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320032#M615567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some help with this as its not as easy as I first thought it might be.&lt;/P&gt;&lt;P&gt;The scenario is that our customers will receive a rebate on there spend as long as they spend more than there agreed threshold.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example of this: If customer 1001 spends more than £100,000 then they will receive 2% rebate of there spend, however if they spend more than £200,000 then they receive %3 rebate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I Want to Achieve&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We want to be able to show automatically the percentage of rebate that each customer will receive for each invoice and then calculate the rebate amount for each invoice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problems&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We have a maximum of 4 tiers of rebate however not all customers have 4 tiers, some have 1 flat rate, some have 2 tiers some 3 and some all 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The percentage and &lt;SPAN style="font-size: 13.3333px;"&gt;threshold &lt;/SPAN&gt;is different for some&amp;nbsp; customers but not all e.g. customer 1001 has a different threshold and percentage rate to customer 1006&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I Have In Mind&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To resolve the problems above I figured it would be best to map in an excel sheet (Test Attached) that contains columns of:&lt;/P&gt;&lt;P&gt;The Customer Number (KEY), Threshold 1 , %Tier 1 , &lt;SPAN style="font-size: 13.3333px;"&gt;Threshold &lt;/SPAN&gt;2, %Tier 2, &lt;SPAN style="font-size: 13.3333px;"&gt;Threshold 3, &lt;SPAN style="font-size: 13.3333px;"&gt;%Tier 3&lt;/SPAN&gt; ,&lt;SPAN style="font-size: 13.3333px;"&gt;Threshold 4, &lt;SPAN style="font-size: 13.3333px;"&gt;%Tier 4&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I need help figuring out how to test the customer spend against each threshold however break if the next threshold is NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;pseudocode&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;var = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF (customer spend &amp;lt; threshold 1)THEN(Break)&lt;/P&gt;&lt;P&gt;ELSE (&lt;/P&gt;&lt;P&gt;IF (customer spend &amp;gt; threshold 1 &amp;amp; &amp;lt; threshold 2) THEN (SET var=%Tier1)&lt;/P&gt;&lt;P&gt;ELSEIF ( IF(%Tier2 = NULL) THEN (BREAK) ELSE (customer spend &amp;gt; threshold 2 &amp;amp; &amp;lt; threshold 3) THEN (SET var=%Tier2))&lt;/P&gt;&lt;P&gt;ELSEIF ( IF(%Tier3 = NULL) THEN (BREAK) ELSE (customer spend &amp;gt; threshold 3 &amp;amp; &amp;lt; threshold 4) THEN (SET var=%Tier3))&lt;/P&gt;&lt;P&gt;ELSE ( IF(%Tier4 = NULL) THEN (BREAK) ELSE (SET var=%Tier4))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;lt;pseudocode&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Aron&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Aron Williamson

Changed psuedo Script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2017 20:59:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320032#M615567</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-03T20:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Complex "If ElseIF ElseIF" Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320033#M615571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't test data, I assume this. And please set variables in script or variable overview where you declare the 4 statements and then use this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ([customer spend] &amp;lt; [threshold 1],'Break',&lt;/P&gt;&lt;P&gt;IF ([customer spend] &amp;gt; [threshold 1] and [chained spend] &amp;lt; [threshold 2], $(%Tier1), &lt;SPAN style="font-size: 10pt;"&gt;NULL(), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;IF([customer spend] &amp;gt; [threshold 2]&amp;nbsp; and [customer spend] &amp;lt; [threshold 3]), $(%Tier2), &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;NULL(),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;IF([customer spend] &amp;gt; [threshold 3]&amp;nbsp; and [customer spend] &amp;lt; [threshold 4], $(%Tier3), N&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ULL()), $(%Tier4))))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2017 00:17:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320033#M615571</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-07-04T00:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Complex "If ElseIF ElseIF" Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320034#M615574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Anil, that was the exact answer! I think when I was asking the question I was overthinking it but you hit the nail right on the head. My exact code looked like the below in the end FYI for anyone this may help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isNull(YArrangment.Threshold2) OR $(CollectiveSPNRev) &amp;lt; YArrangment.Threshold2 , YArrangment.Rebate1 , if(isNull(YArrangment.Threshold3) OR $(CollectiveSPNRev) &amp;lt; YArrangment.Threshold3 , YArrangment.Rebate2, if(isNull(YArrangment.Threshold4) OR $(CollectiveSPNRev) &amp;lt; YArrangment.Threshold4 , YArrangment.Rebate3, if(IsNull(YArrangment.Rebate4), YArrangment.Rebate3, YArrangment.Rebate4))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2017 09:22:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320034#M615574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-18T09:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Complex "If ElseIF ElseIF" Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320035#M615575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't think much. Anyway, you deserve !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2017 10:12:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-With-Complex-quot-If-ElseIF-ElseIF-quot-Statement/m-p/1320035#M615575</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-07-18T10:12:50Z</dc:date>
    </item>
  </channel>
</rss>

