<?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's not working as expected in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546424#M457066</link>
    <description>&lt;P&gt;difference &amp;gt; &amp;amp; = to signs on both the if's&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 14:55:16 GMT</pubDate>
    <dc:creator>dseelam</dc:creator>
    <dc:date>2019-02-19T14:55:16Z</dc:date>
    <item>
      <title>Multiple if's not working as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546413#M457063</link>
      <description>&lt;P&gt;Hello Qlik Folks,&lt;/P&gt;&lt;P&gt;Why can't I write multiple if's like this, only 1st statement is working as expected.&lt;/P&gt;&lt;P&gt;if(len(trim([Begin Date]))=0 and len(trim([End Date]))=0, 'Closeouts','Excl Closeout'),&lt;BR /&gt;if(len(trim([Begin Date]))&amp;gt;0 and len(trim([End Date]))&amp;gt;0, 'Closeouts','Excl Closeout')&lt;BR /&gt;as CloseoutDesc&lt;/P&gt;&lt;P&gt;expected output attached&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546413#M457063</guid>
      <dc:creator>dseelam</dc:creator>
      <dc:date>2019-02-19T14:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if's not working as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546417#M457064</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Unless I'm missing something, your second IF is exactly the same as the first and will never be executed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(len(trim([Begin Date]))=0 and len(trim([End Date]))=0, 'Closeouts','Excl Closeout')&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;as CloseoutDesc&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:46:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546417#M457064</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2019-02-19T14:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if's not working as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546419#M457065</link>
      <description>&lt;P&gt;You should write nested ifs like this:&lt;/P&gt;&lt;PRE&gt;if(condition 1, true,
   if(condition 2, true, false)) as field1&lt;/PRE&gt;&lt;P&gt;Your case&lt;/P&gt;&lt;PRE&gt;if(
     (len(trim([Begin Date]))=0 and len(trim([End Date]))=0) // 1 condition
     OR 
     (len(trim([Begin Date]))&amp;gt;0 and len(trim([End Date]))&amp;gt;0), // 2 condition
'Closeouts','Excl Closeout') as CloseoutDesc&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;also you can use &amp;gt;= operator and simplify if&lt;/P&gt;&lt;PRE&gt;if(len(trim([Begin Date]))&amp;gt;=0 and len(trim([End Date]))&amp;gt;=0,&amp;nbsp;&amp;nbsp;'Closeouts','Excl Closeout') as CloseoutDesc&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546419#M457065</guid>
      <dc:creator>mrybalko</dc:creator>
      <dc:date>2019-02-19T14:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if's not working as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546424#M457066</link>
      <description>&lt;P&gt;difference &amp;gt; &amp;amp; = to signs on both the if's&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:55:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546424#M457066</guid>
      <dc:creator>dseelam</dc:creator>
      <dc:date>2019-02-19T14:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if's not working as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546425#M457067</link>
      <description>&lt;P&gt;Awesome this is what am exactly looking for&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:57:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-if-s-not-working-as-expected/m-p/1546425#M457067</guid>
      <dc:creator>dseelam</dc:creator>
      <dc:date>2019-02-19T14:57:20Z</dc:date>
    </item>
  </channel>
</rss>

