<?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 if statement question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-statement-question/m-p/198988#M58100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is seemingly simple but is causing me headache:&lt;/P&gt;&lt;P&gt;I have a variable which can be empty or have a value, i.e.&lt;/P&gt;&lt;P&gt;set myvar = ;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;set marvar = 1;&lt;/P&gt;&lt;P&gt;I'm assuming that elsewhere I can test&lt;/P&gt;&lt;P&gt;if '$(myvar)' then or if isnull('$(myvar)') then&lt;/P&gt;&lt;P&gt;but this isn't working. I've tried many ways but didn't find a solution. I get an error message "script line error if ... then". $(#myvar) crashes script without any error.&lt;/P&gt;&lt;P&gt;On top of that putting msgbox('$(&lt;B&gt;ScriptErrorDetails&lt;/B&gt;)') doesn't work, MsgBox isn't recoginzed in the script.&lt;/P&gt;&lt;P&gt;I have a feeling that I'm missing something very basic. Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Dec 2009 08:35:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-31T08:35:43Z</dc:date>
    <item>
      <title>if statement question</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-question/m-p/198988#M58100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is seemingly simple but is causing me headache:&lt;/P&gt;&lt;P&gt;I have a variable which can be empty or have a value, i.e.&lt;/P&gt;&lt;P&gt;set myvar = ;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;set marvar = 1;&lt;/P&gt;&lt;P&gt;I'm assuming that elsewhere I can test&lt;/P&gt;&lt;P&gt;if '$(myvar)' then or if isnull('$(myvar)') then&lt;/P&gt;&lt;P&gt;but this isn't working. I've tried many ways but didn't find a solution. I get an error message "script line error if ... then". $(#myvar) crashes script without any error.&lt;/P&gt;&lt;P&gt;On top of that putting msgbox('$(&lt;B&gt;ScriptErrorDetails&lt;/B&gt;)') doesn't work, MsgBox isn't recoginzed in the script.&lt;/P&gt;&lt;P&gt;I have a feeling that I'm missing something very basic. Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 08:35:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-question/m-p/198988#M58100</guid>
      <dc:creator />
      <dc:date>2009-12-31T08:35:43Z</dc:date>
    </item>
    <item>
      <title>if statement question</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-question/m-p/198989#M58101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;if Trim('$(myvar)') = '' or isnull('$(myvar)') then&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 11:23:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-question/m-p/198989#M58101</guid>
      <dc:creator>amars</dc:creator>
      <dc:date>2009-12-31T11:23:56Z</dc:date>
    </item>
    <item>
      <title>if statement question</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-question/m-p/198990#M58102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Normally you do not need the apostrophs, they are only needed when explicitly you need to declare a string. Within the normal statements in the script you also do not need to use the $(...), just the name should do it. Thus your statement should read&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;IF myvar = 1 THEN ... ELSE ... END IF&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;n.b.: If you can avoid it, would not have a variable containing NULL-value. It is better to have it reading either 0 or 1.&lt;/P&gt;&lt;P&gt;HTH&lt;BR /&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 16:02:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-question/m-p/198990#M58102</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2009-12-31T16:02:22Z</dc:date>
    </item>
  </channel>
</rss>

