<?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: something wrong with my if expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249072#M707012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stephen! That to is a very good approch &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On donderdag 2 februari 2012 at 6:24 PM, Stephen Redmond  wrote:   &lt;/P&gt;&lt;P&gt; 		  QlikCommunity &lt;/P&gt;&lt;P&gt;      Re: something wrong with my if expression       created by&lt;/P&gt;&lt;P&gt;Stephen Redmond in &lt;U&gt;Development (QlikView Desktop)&lt;/U&gt; - View the full&lt;/P&gt;&lt;P&gt;discussion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Feb 2012 19:44:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-02T19:44:02Z</dc:date>
    <item>
      <title>something wrong with my if expression</title>
      <link>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249068#M707008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm proberly doing something wrong, I have a filename: Commercial_ED_REL_GCPR_272022793_2011-12-29.txt&lt;/P&gt;&lt;P&gt;Where I allready extracted the Ordernumber from by using the following expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid(filename(),Index(filename(),'PR_')+3,9) as OrderNo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm trying to add an if statement to it, if the number after 'PR_'starts with 27 then 'True' otherwise 'False'. &lt;/P&gt;&lt;P&gt;This is my expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(mid(filename(),index(filename(),'PL_')+3,2)='27','True','False') as Test,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There must be something wrong with my expression since I only get False as a result. &lt;/P&gt;&lt;P&gt;Hope someone can help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 17:09:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249068#M707008</guid>
      <dc:creator />
      <dc:date>2012-02-02T17:09:05Z</dc:date>
    </item>
    <item>
      <title>something wrong with my if expression</title>
      <link>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249069#M707009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shouldn't you use 'P&lt;STRONG&gt;R&lt;/STRONG&gt;_' as second argument to the index function?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 17:20:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249069#M707009</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-02-02T17:20:28Z</dc:date>
    </item>
    <item>
      <title>something wrong with my if expression</title>
      <link>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249070#M707010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find that too many functions and subfunctions can confuse me so I will generally turn to the Preceeding Load to do this type of thing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(Left(OrderNo, 2)=27, 'True', 'False') As Is27,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SubField(filename, '_', 5) as OrderNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*;&lt;/P&gt;&lt;P&gt;LOAD Field1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field2, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field3,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName() as filename&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Commercial_ED_REL_GCPR_272022793_2011-12-29.txt]&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that I have used the SubField function to extract the OrderNo - I think that it is a better method if the filename has a fixed structure like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 17:24:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249070#M707010</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2012-02-02T17:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: something wrong with my if expression</title>
      <link>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249071#M707011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks! I'm appearantly not so sharp at the end of the day. lol &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; But&lt;/P&gt;&lt;P&gt;you are right! It should have been 'PR_' instead of 'PL'_.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On donderdag 2 februari 2012 at 6:20 PM, swuehl  wrote:   &lt;/P&gt;&lt;P&gt; 		  QlikCommunity &lt;/P&gt;&lt;P&gt;      Re: something wrong with my if expression       created by&lt;/P&gt;&lt;P&gt;swuehl in &lt;U&gt;Development (QlikView Desktop)&lt;/U&gt; - View the full discussion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 19:41:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249071#M707011</guid>
      <dc:creator />
      <dc:date>2012-02-02T19:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: something wrong with my if expression</title>
      <link>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249072#M707012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stephen! That to is a very good approch &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On donderdag 2 februari 2012 at 6:24 PM, Stephen Redmond  wrote:   &lt;/P&gt;&lt;P&gt; 		  QlikCommunity &lt;/P&gt;&lt;P&gt;      Re: something wrong with my if expression       created by&lt;/P&gt;&lt;P&gt;Stephen Redmond in &lt;U&gt;Development (QlikView Desktop)&lt;/U&gt; - View the full&lt;/P&gt;&lt;P&gt;discussion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 19:44:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/something-wrong-with-my-if-expression/m-p/249072#M707012</guid>
      <dc:creator />
      <dc:date>2012-02-02T19:44:02Z</dc:date>
    </item>
  </channel>
</rss>

