<?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 Converting Nested IFs in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238347#M89246</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you conversion isn't 100% right!&lt;/P&gt;&lt;P&gt;Your original statement was:&lt;/P&gt;&lt;P&gt;if (Rbu == 700308 || Rbu == 700309 || Rbu == 700310) {"2. SHF" } else { if ( Substr ( Rbu, 4, 1 ) == "3") {"1. FBU" } else { if (Substr ( Rbu, 4, 1 ) == "4" ) {"3. VBU" } else { if (Substr ( Rbu, 4, 1 ) == "7" ) {"2. ABU" } else { if ( Substr ( Rbu, 4, 1 ) == "6") {"3. NBU" } else {"Missing" }}}}}&lt;/P&gt;&lt;P&gt;The first step is to check if Rbu equals the values 700308, 700309 or 700310. If this isn't the case you check the 4th number of the Rbu string.&lt;/P&gt;&lt;P&gt;With this statement:&lt;/P&gt;&lt;P&gt;if(mid(RBU,4,1)='3','1. FBU',&lt;BR /&gt; if(mid(RBU,4,1)='4','4. VBU',&lt;BR /&gt; if(mid(RBU,4,1)='7','2. ABU',&lt;BR /&gt; if(mid(RBU,4,1)='6','3. NBU',&lt;BR /&gt; if(RBU='700308' or RBU='700309' or RBU='700310','2. SHF','Missing')))))&lt;BR /&gt; as "Revised_RBU",&lt;/P&gt;&lt;P&gt;you check first the 4th number! Because 700308 = mid(RBU,4,1)='3' you'll get 'FBU' instead of 'SHF' !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Oct 2010 09:07:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-10-16T09:07:18Z</dc:date>
    <item>
      <title>Converting Nested IFs</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238344#M89243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am converting an old Hyperion query to QlikView and need to convert the following code to its SWITCH/CASE equivalent in the load script. But I'm not sure how to handle the substrings. Can anyone offer some help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (Rbu == 700308 || Rbu == 700309 || Rbu == 700310) {"2. SHF" } else { if ( Substr ( Rbu, 4, 1 ) == "3") {"1. FBU" } else { if (Substr ( Rbu, 4, 1 ) == "4" ) {"3. VBU" } else { if (Substr ( Rbu, 4, 1 ) == "7" ) {"2. ABU" } else { if ( Substr ( Rbu, 4, 1 ) == "6") {"3. NBU" } else {"Missing" }}}}}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Oct 2010 23:18:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238344#M89243</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-14T23:18:13Z</dc:date>
    </item>
    <item>
      <title>Converting Nested IFs</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238345#M89244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have never used the switch/case in the script and I'm not sure if Rbu is the column name or a variable, but would something like the following work:&lt;/P&gt;&lt;P&gt;Switch mid(Rbu,4,1)&lt;/P&gt;&lt;P&gt;Case 3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Case 4&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Oct 2010 23:49:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238345#M89244</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-10-14T23:49:45Z</dc:date>
    </item>
    <item>
      <title>Converting Nested IFs</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238346#M89245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like Switch statements are not supported within a Load statement. The following code worked. My thanks to Stefan Walther at QlikBlog.at for his explanation and his excellent Nested If tool.&lt;/P&gt;&lt;P&gt;http://www.qlikblog.at/464/tool-creating-nested-ifstatements/&lt;/P&gt;&lt;P&gt;RBU,&lt;BR /&gt; if(mid(RBU,4,1)='3','1. FBU',&lt;BR /&gt; if(mid(RBU,4,1)='4','4. VBU',&lt;BR /&gt; if(mid(RBU,4,1)='7','2. ABU',&lt;BR /&gt; if(mid(RBU,4,1)='6','3. NBU',&lt;BR /&gt; if(RBU='700308' or RBU='700309' or RBU='700310','2. SHF','Missing')))))&lt;BR /&gt; as "Revised_RBU",&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Oct 2010 02:13:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238346#M89245</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-15T02:13:02Z</dc:date>
    </item>
    <item>
      <title>Converting Nested IFs</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238347#M89246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you conversion isn't 100% right!&lt;/P&gt;&lt;P&gt;Your original statement was:&lt;/P&gt;&lt;P&gt;if (Rbu == 700308 || Rbu == 700309 || Rbu == 700310) {"2. SHF" } else { if ( Substr ( Rbu, 4, 1 ) == "3") {"1. FBU" } else { if (Substr ( Rbu, 4, 1 ) == "4" ) {"3. VBU" } else { if (Substr ( Rbu, 4, 1 ) == "7" ) {"2. ABU" } else { if ( Substr ( Rbu, 4, 1 ) == "6") {"3. NBU" } else {"Missing" }}}}}&lt;/P&gt;&lt;P&gt;The first step is to check if Rbu equals the values 700308, 700309 or 700310. If this isn't the case you check the 4th number of the Rbu string.&lt;/P&gt;&lt;P&gt;With this statement:&lt;/P&gt;&lt;P&gt;if(mid(RBU,4,1)='3','1. FBU',&lt;BR /&gt; if(mid(RBU,4,1)='4','4. VBU',&lt;BR /&gt; if(mid(RBU,4,1)='7','2. ABU',&lt;BR /&gt; if(mid(RBU,4,1)='6','3. NBU',&lt;BR /&gt; if(RBU='700308' or RBU='700309' or RBU='700310','2. SHF','Missing')))))&lt;BR /&gt; as "Revised_RBU",&lt;/P&gt;&lt;P&gt;you check first the 4th number! Because 700308 = mid(RBU,4,1)='3' you'll get 'FBU' instead of 'SHF' !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Oct 2010 09:07:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238347#M89246</guid>
      <dc:creator />
      <dc:date>2010-10-16T09:07:18Z</dc:date>
    </item>
    <item>
      <title>Converting Nested IFs</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238348#M89247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct. I changed it right after I noticed it was wrong. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Oct 2010 03:54:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Nested-IFs/m-p/238348#M89247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-17T03:54:52Z</dc:date>
    </item>
  </channel>
</rss>

