<?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.. Then.. Else not working as intended with ScriptError in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285546#M622625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been searching the forums for a solution or explanation however until now i am not able to find either &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is the situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a script in which a connection is made via ODBC to a SQL source.&lt;/P&gt;&lt;P&gt;However i would like QlikView to load existing data from QVD's if the ODBC connection cannot be established (via the ScriptError) but i do not seem to get this working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the same idea with setting up a variable which should set the value to "Good" if the THEN bit is processed and "Bad" when the ELSE bit is processed but i only seem to getting the ELSE bit being processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;SET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Errormode&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=0;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ODBC&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;CONNECT&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Test;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vScriptError&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptError&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vScriptErrorDetails&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptErrorDetails&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;If&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptError&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=1 &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vTest&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Good';&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;ELSE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vTest&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Bad';&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;END&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;IF &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried multiple ScriptError codes and &amp;gt;0 but nothing seems to trigger the THEN bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin van der Bent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2017 11:49:17 GMT</pubDate>
    <dc:creator>katwijck</dc:creator>
    <dc:date>2017-01-20T11:49:17Z</dc:date>
    <item>
      <title>IF.. Then.. Else not working as intended with ScriptError</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285546#M622625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been searching the forums for a solution or explanation however until now i am not able to find either &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is the situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a script in which a connection is made via ODBC to a SQL source.&lt;/P&gt;&lt;P&gt;However i would like QlikView to load existing data from QVD's if the ODBC connection cannot be established (via the ScriptError) but i do not seem to get this working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the same idea with setting up a variable which should set the value to "Good" if the THEN bit is processed and "Bad" when the ELSE bit is processed but i only seem to getting the ELSE bit being processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;SET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Errormode&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=0;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ODBC&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;CONNECT&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Test;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vScriptError&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptError&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vScriptErrorDetails&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptErrorDetails&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;If&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptError&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=1 &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vTest&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Good';&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;ELSE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vTest&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Bad';&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;END&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;IF &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried multiple ScriptError codes and &amp;gt;0 but nothing seems to trigger the THEN bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin van der Bent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 11:49:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285546#M622625</guid>
      <dc:creator>katwijck</dc:creator>
      <dc:date>2017-01-20T11:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: IF.. Then.. Else not working as intended with ScriptError</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285547#M622626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you are using a wrong statement for your if condition. The ScriptError statement gives you a string, not a numeric value. Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET Errormode=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO Test;&lt;/P&gt;&lt;P&gt;//Let vScriptError = ScriptError;&lt;/P&gt;&lt;P&gt;Let vScriptError = ScriptErrorCount;&lt;/P&gt;&lt;P&gt;Let vScriptErrorDetails = ScriptErrorDetails;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If '$(vScriptError)'=1 THEN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vTest='Good';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vTest='Bad';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END IF&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;Enrique.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 17:19:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285547#M622626</guid>
      <dc:creator>eespiritu</dc:creator>
      <dc:date>2017-01-20T17:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: IF.. Then.. Else not working as intended with ScriptError</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285548#M622627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;SET Errormode=0;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ODBC CONNECT TO Test;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vScriptError = ScriptError;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vScriptErrorDetails = ScriptErrorDetails;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If &lt;STRONG&gt;vScriptError=0&lt;/STRONG&gt; THEN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET vTest='Good';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ELSE&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET vTest='Bad';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;END IF&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TRACE $(vTest);&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:05:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285548#M622627</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-01-20T18:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: IF.. Then.. Else not working as intended with ScriptError</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285549#M622628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Enrique,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have validated this approach and it seems to do the trick!&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin van der Bent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 08:26:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285549#M622628</guid>
      <dc:creator>katwijck</dc:creator>
      <dc:date>2017-01-23T08:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: IF.. Then.. Else not working as intended with ScriptError</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285550#M622629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Massimo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the mistakes I have made in my script, thanks for pointing it out, works like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin van der Bent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 08:27:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Then-Else-not-working-as-intended-with-ScriptError/m-p/1285550#M622629</guid>
      <dc:creator>katwijck</dc:creator>
      <dc:date>2017-01-23T08:27:20Z</dc:date>
    </item>
  </channel>
</rss>

