<?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 HELP in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868177#M71691</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;i have an if statement that i use whereby it will fail the app on purpose if the max date is &amp;lt;= the time of a different qlik app.&lt;/P&gt;
&lt;P&gt;however, for some reason the app is not failing and i cant understand why.&lt;/P&gt;
&lt;P&gt;my if statement:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="#99CC00"&gt;//if max date of source files is less than the date of report late reload – 10 minutes then no need to reload the qlikview report&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if maxdate&amp;lt;= num($v_NUM_File_Date-10/1440) then&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;drop table Nonexistabtable;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;end if &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#99CC00"&gt;//dropping a table which does not exist causes the qlikview report to error&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;and when i put the maxdate and $v_NUM_File_Date in a text object i get the following:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maarcus_smith_0-1638977764267.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68191i3E57D624B9C5B01D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maarcus_smith_0-1638977764267.png" alt="maarcus_smith_0-1638977764267.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;surely based off the above this app should fail? however it is not its running fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any ideas?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Dec 2021 15:43:09 GMT</pubDate>
    <dc:creator>maarcus_smith</dc:creator>
    <dc:date>2021-12-08T15:43:09Z</dc:date>
    <item>
      <title>IF STATEMENT HELP</title>
      <link>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868177#M71691</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;i have an if statement that i use whereby it will fail the app on purpose if the max date is &amp;lt;= the time of a different qlik app.&lt;/P&gt;
&lt;P&gt;however, for some reason the app is not failing and i cant understand why.&lt;/P&gt;
&lt;P&gt;my if statement:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="#99CC00"&gt;//if max date of source files is less than the date of report late reload – 10 minutes then no need to reload the qlikview report&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if maxdate&amp;lt;= num($v_NUM_File_Date-10/1440) then&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;drop table Nonexistabtable;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;end if &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#99CC00"&gt;//dropping a table which does not exist causes the qlikview report to error&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;and when i put the maxdate and $v_NUM_File_Date in a text object i get the following:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maarcus_smith_0-1638977764267.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68191i3E57D624B9C5B01D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maarcus_smith_0-1638977764267.png" alt="maarcus_smith_0-1638977764267.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;surely based off the above this app should fail? however it is not its running fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any ideas?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 15:43:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868177#M71691</guid>
      <dc:creator>maarcus_smith</dc:creator>
      <dc:date>2021-12-08T15:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: IF STATEMENT HELP</title>
      <link>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868184#M71692</link>
      <description>&lt;P&gt;Run your app in debug mode, step by step, and you should be able to see the flow and the variable values and figure out what it's doing. One thing I'd look at is to keep the types consistent, so if you're going to num() one, you should num() the other, but that might not be related at all, just good practice in general.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 15:47:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868184#M71692</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-12-08T15:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: IF STATEMENT HELP</title>
      <link>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868208#M71697</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6142"&gt;@Or&lt;/a&gt;&amp;nbsp;, yes i have them kept at num in my script and have gone through debug mode, it appears that it just skips the "&lt;SPAN&gt;drop table Nonexistabtable&lt;/SPAN&gt;" completely&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i went to debug and it looks like it has a null for the maxdate? am i reading it correctly? is that why my if statement is not working?&lt;/P&gt;
&lt;P&gt;how could it be null in the if statement but once the app opens, there is a maxdate in there?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maarcus_smith_0-1638979953747.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68194i0AB45B2BB3A0A583/image-size/large?v=v2&amp;amp;px=999" role="button" title="maarcus_smith_0-1638979953747.png" alt="maarcus_smith_0-1638979953747.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 16:13:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868208#M71697</guid>
      <dc:creator>maarcus_smith</dc:creator>
      <dc:date>2021-12-08T16:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: IF STATEMENT HELP</title>
      <link>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868265#M71703</link>
      <description>&lt;P&gt;MaxDate could be a field rather than a variable, in which case you could use it in the front-end but not in the control statement. Why are you using MaxDate when you appear to already have a vMaxDate set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 17:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868265#M71703</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-12-08T17:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: IF STATEMENT HELP</title>
      <link>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868277#M71706</link>
      <description>&lt;P&gt;i was using a field as i was concatenating two different max dates together. however as you suggested, i just made it a variable using&amp;nbsp; let vMaxDate2 = peek('maxdate') and it worked!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;thanks so much for your help i didnt know you couldn't use a field in control statement in script!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 18:03:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IF-STATEMENT-HELP/m-p/1868277#M71706</guid>
      <dc:creator>maarcus_smith</dc:creator>
      <dc:date>2021-12-08T18:03:18Z</dc:date>
    </item>
  </channel>
</rss>

