<?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: Trying to force an error in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trying-to-force-an-error-in-script/m-p/1016808#M939278</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think after the SQL, you just have a field vpublish, no variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a Peek to create a variable from field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;last_update:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;select &lt;BR /&gt;client_id &lt;BR /&gt;,dm_name &lt;BR /&gt;,last_dm_update_date&lt;BR /&gt;,convert(date,GETDATE()) as curdate&lt;BR /&gt;,case when datediff(dd,last_dm_update_date, convert(date,getdate())) &amp;lt;=1 then 'Yes'&lt;BR /&gt;else 'No' end [vpublish]&lt;BR /&gt;from dbReferences.dbo.t_clients&lt;BR /&gt;where client_id = 2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;Let vpublish = Peek('vpublish',-1,'last_update');&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;TRACE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; vpublish=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vpublish)&lt;/EM&gt;&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;If&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;vpublish&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'No') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&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;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; *&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; inexistent.txt(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;txt&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;codepage&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1252, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;no&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;delimiter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ',',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;msq&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;END&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2016 20:57:30 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-01-29T20:57:30Z</dc:date>
    <item>
      <title>Trying to force an error in script</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-force-an-error-in-script/m-p/1016807#M939277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although my code seems logical it is not working.&amp;nbsp; The field that I create in the SQL called vpublish is not passing its value to the If statement below it.&amp;nbsp; The Trace shows that it is blank.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is for the script to try to load the txt file (which does not exist) when vpublish = 'No' and to finish successfully if vpublish = 'Yes'.&amp;nbsp; My plan is to make my dashboard tasks dependent on this task so they don't run if there is no new data.&lt;/P&gt;&lt;P&gt;Do I need to add a Resident Load for the If statement to work?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;last_update:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;select &lt;BR /&gt;client_id &lt;BR /&gt;,dm_name &lt;BR /&gt;,last_dm_update_date&lt;BR /&gt;,convert(date,GETDATE()) as curdate&lt;BR /&gt;,case when datediff(dd,last_dm_update_date, convert(date,getdate())) &amp;lt;=1 then 'Yes'&lt;BR /&gt;else 'No' end [vpublish]&lt;BR /&gt;from dbReferences.dbo.t_clients&lt;BR /&gt;where client_id = 2;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;TRACE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; vpublish=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vpublish)&lt;/EM&gt;&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;If&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;vpublish&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'No') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&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;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; *&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; inexistent.txt(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;txt&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;codepage&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1252, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;no&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;delimiter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ',',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;msq&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;END&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 20:46:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-force-an-error-in-script/m-p/1016807#M939277</guid>
      <dc:creator>rittermd</dc:creator>
      <dc:date>2016-01-29T20:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to force an error in script</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-force-an-error-in-script/m-p/1016808#M939278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think after the SQL, you just have a field vpublish, no variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a Peek to create a variable from field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;last_update:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;select &lt;BR /&gt;client_id &lt;BR /&gt;,dm_name &lt;BR /&gt;,last_dm_update_date&lt;BR /&gt;,convert(date,GETDATE()) as curdate&lt;BR /&gt;,case when datediff(dd,last_dm_update_date, convert(date,getdate())) &amp;lt;=1 then 'Yes'&lt;BR /&gt;else 'No' end [vpublish]&lt;BR /&gt;from dbReferences.dbo.t_clients&lt;BR /&gt;where client_id = 2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;Let vpublish = Peek('vpublish',-1,'last_update');&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;TRACE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; vpublish=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vpublish)&lt;/EM&gt;&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;If&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;vpublish&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'No') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&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;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; *&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; inexistent.txt(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;txt&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;codepage&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1252, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;no&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;delimiter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ',',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;msq&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;END&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 20:57:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-force-an-error-in-script/m-p/1016808#M939278</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-01-29T20:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to force an error in script</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-force-an-error-in-script/m-p/1016809#M939279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;small example, replace the bold with your sql load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;T:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;load&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; 'No' as&amp;nbsp; vpublish&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;AutoGenerate 1;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;let vpublish = Peek('vpublish');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TRACE vpublish='$(vpublish)';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If ('$(vpublish)' = 'No') THEN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; trace NO;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; LOAD * FROM inexistent.txt(txt, codepage is 1252, no labels, delimiter is ',',msq);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;END IF;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 20:59:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-force-an-error-in-script/m-p/1016809#M939279</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-01-29T20:59:45Z</dc:date>
    </item>
  </channel>
</rss>

