<?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: If then statement in script, evaluates the same in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306701#M614524</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct me not sure i understand your query. &lt;/P&gt;&lt;P&gt;Your script says if no of records from Values_Sources is &amp;gt; 0 then &lt;/P&gt;&lt;P&gt;you want to set your vBuildQVD = 'False' ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vBuil,dQVD = 'True'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You dont have any records in your table. So it always be true. So what exactly you are trying to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jul 2017 20:19:04 GMT</pubDate>
    <dc:creator>vishsaggi</dc:creator>
    <dc:date>2017-07-13T20:19:04Z</dc:date>
    <item>
      <title>If then statement in script, evaluates the same</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306700#M614523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="ifthen.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/170184_ifthen.png" style="height: 118px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;For some reason, and I've tried many scenarios, the above always sets BuildQvd to true.&lt;/P&gt;&lt;P&gt;I have ValueSources in the path file, yet it still builds it each time.&lt;/P&gt;&lt;P&gt;Any idea why?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2017 19:51:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306700#M614523</guid>
      <dc:creator />
      <dc:date>2017-07-13T19:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement in script, evaluates the same</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306701#M614524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct me not sure i understand your query. &lt;/P&gt;&lt;P&gt;Your script says if no of records from Values_Sources is &amp;gt; 0 then &lt;/P&gt;&lt;P&gt;you want to set your vBuildQVD = 'False' ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vBuil,dQVD = 'True'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You dont have any records in your table. So it always be true. So what exactly you are trying to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2017 20:19:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306701#M614524</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2017-07-13T20:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement in script, evaluates the same</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306702#M614525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the reason are missing single-quotes and a $-sign expansion around your variable which are needed if the variable contained string-values. It should be look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;if '$(vBuildQVD)' = 'True' then&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whereby in your above scenario you don't need these variables - you could directly use the first if with the QVDNoOfRecords to switch in your different branches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside them it's quite often useful to create numeric or even better boolean variables instead of strings. In your case it could be for examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vBuildQVD = ceil(QVDNoOfRecords('path/file.qvd') / 100000000000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which returned 0 respectively FALSE if there is no record and 1 respectively TRUE if there is any record (whereby each number unless 0 will be in Qlik treated as TRUE).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 07:33:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306702#M614525</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-07-14T07:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement in script, evaluates the same</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306703#M614526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I'm not mistaken, QvdNumberofRecords returns the records in that qvd. So since I already have that qvd with data in it, it should be greater than 0, so then it doesnt rebuild the qvd from scratch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 14:00:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306703#M614526</guid>
      <dc:creator />
      <dc:date>2017-07-14T14:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement in script, evaluates the same</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306704#M614527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was having issues with it always evaluating to the same value.&lt;/P&gt;&lt;P&gt;This is what fixed it. &lt;/P&gt;&lt;P&gt;If the file doesnt exist, the records will be null, not zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vQVDExists = not isnull(QvdCreateTime('filepath.qvd'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if $(vQVDExists) = 0 then&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;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 14:31:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-statement-in-script-evaluates-the-same/m-p/1306704#M614527</guid>
      <dc:creator />
      <dc:date>2017-07-14T14:31:27Z</dc:date>
    </item>
  </channel>
</rss>

