<?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: error with if statement in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595380#M595787</link>
    <description>Are you sure exact code runs on local machine??&lt;BR /&gt;As per if.. then.. else... syntax there is no ; after then.&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;do you have same version on both?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant Sangle</description>
    <pubDate>Tue, 25 Jun 2019 05:18:36 GMT</pubDate>
    <dc:creator>PrashantSangle</dc:creator>
    <dc:date>2019-06-25T05:18:36Z</dc:date>
    <item>
      <title>error with if statement in load script</title>
      <link>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595341#M595786</link>
      <description>&lt;P&gt;I have some code which is failing on my testing server but runs fine locally.&amp;nbsp; The code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HolidayList:
LOAD
	Concat(chr(39)&amp;amp;date([HLDY_DT])&amp;amp;chr(39),',') as HolidayDates
Resident tempHolidays
where Year([HLDY_DT]) &amp;gt;= '2019';

Let vPublicHolidays = fieldvalue('HolidayDates',1);

drop table tempHolidays;

if LastWorkDate(MonthStart(Max(Today(1))), 1, $(vPublicHolidays)) = Today(1) then;
	Set vHoliDate = 'True';
ELSE;
	Set vHoliDate = 'False';
end if;

if (vHoliDate = 'True') or (vBypass1stWorkDayofMonth = 1) Then;

         [run some code]

end if;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when i run the script on the testing server, this is the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;6/21/2019 12:14:02 AM: 0046  HolidayList:
6/21/2019 12:14:02 AM: 0047  LOAD
6/21/2019 12:14:02 AM: 0048  	Concat(chr(39)&amp;amp;date([HLDY_DT])&amp;amp;chr(39),',') as HolidayDates
6/21/2019 12:14:02 AM: 0049  Resident tempHolidays
6/21/2019 12:14:02 AM: 0050  where Year([HLDY_DT]) &amp;gt;= '2019'
6/21/2019 12:14:02 AM:       	1 fields found: HolidayDates, 1 lines fetched
6/21/2019 12:14:02 AM: 0052  Let vPublicHolidays = fieldvalue('HolidayDates',1)
6/21/2019 12:14:02 AM: 0054  drop table tempHolidays
6/21/2019 12:14:02 AM: 0056  if LastWorkDate(MonthStart(Max(Today(1))), 1, '1/1/2019','1/12/2019','1/13/2019','1/19/2019','1/20/2019','1/21/2019','1/26/2019','1/27/2019','1/5/2019','1/6/2019','10/12/2019','10/13/2019','10/14/2019','10/19/2019','10/20/2019','10/26/2019','10/27/2019','10/5/2019','10/6/2019','11/10/2019','11/11/2019','11/16/2019','11/17/2019','11/2/2019','11/23/2019','11/24/2019','11/28/2019','11/3/2019','11/30/2019','11/9/2019','12/1/2019','12/14/2019','12/15/2019','12/21/2019','12/22/2019','12/25/2019','12/28/2019','12/29/2019','12/7/2019','12/8/2019','2/10/2019','2/16/2019','2/17/2019','2/18/2019','2/2/2019','2/23/2019','2/24/2019','2/3/2019','2/9/2019','3/10/2019','3/16/2019','3/17/2019','3/2/2019','3/23/2019','3/24/2019','3/3/2019','3/30/2019','3/31/2019','3/9/2019','4/13/2019','4/14/2019','4/20/2019','4/21/2019','4/27/2019','4/28/2019','4/6/2019','4/7/2019','5/11/2019','5/12/2019','5/18/2019','5/19/2019','5/25/2019','5/26/2019','5/27/2019','5/4/2019','5/5/2019','6/1/2019','6/15/2019','6/16/2019','6/2/2019','6/22/2019','6/23/2019','6/29/2019','6/30/2019','6/8/2019','6/9/2019','7/13/2019','7/14/2019','7/20/2019','7/21/2019','7/27/2019','7/28/2019','7/4/2019','7/6/2019','7/7/2019','8/10/2019','8/11/2019','8/17/2019','8/18/2019','8/24/2019','8/25/2019','8/3/2019','8/31/2019','8/4/2019','9/1/2019','9/14/2019','9/15/2019','9/2/2019','9/21/2019','9/22/2019','9/28/2019','9/29/2019','9/7/2019','9/8/2019') = Today(1) then
6/21/2019 12:14:02 AM:       Error: Script line error: 
6/21/2019 12:14:02 AM:       General Script Error
6/21/2019 12:14:02 AM:       Execution Failed
6/21/2019 12:14:02 AM:      Execution finished.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like it's failing after the first 'If statement'.&amp;nbsp; Can someone have a look and tell me what might be the issue?&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;BTW.. i've tried with and without the semicolons on the If statements.... still no dice.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595341#M595786</guid>
      <dc:creator>veldetta</dc:creator>
      <dc:date>2024-11-16T20:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: error with if statement in load script</title>
      <link>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595380#M595787</link>
      <description>Are you sure exact code runs on local machine??&lt;BR /&gt;As per if.. then.. else... syntax there is no ; after then.&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;do you have same version on both?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant Sangle</description>
      <pubDate>Tue, 25 Jun 2019 05:18:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595380#M595787</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2019-06-25T05:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: error with if statement in load script</title>
      <link>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595420#M595788</link>
      <description>&lt;LI-CODE lang="markup"&gt;HolidayList:
LOAD
	Concat(chr(39)&amp;amp;date([HLDY_DT])&amp;amp;chr(39),',') as HolidayDates
Resident tempHolidays
where Year([HLDY_DT]) &amp;gt;= '2019';

Let vPublicHolidays = fieldvalue('HolidayDates',1);

drop table tempHolidays;

if LastWorkDate(MonthStart(Max(Today(1))), 1, $(vPublicHolidays)) = Today(1) then
	Set vHoliDate = 'True';
ELSE
	Set vHoliDate = 'False';
end if;

if (vHoliDate = 'True') or (vBypass1stWorkDayofMonth = 1) Then

      [run some code]

end if;&lt;/LI-CODE&gt;&lt;P&gt;try above code,&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 06:48:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595420#M595788</guid>
      <dc:creator>sasikanth</dc:creator>
      <dc:date>2019-06-25T06:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: error with if statement in load script</title>
      <link>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595714#M595789</link>
      <description>&lt;P&gt;Thanks for asking the question.&amp;nbsp; I'm using v12.0... Server must have a lower version.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed the code... this works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HolidayList:
LOAD
	Concat(chr(39)&amp;amp;date([HLDY_DT])&amp;amp;chr(39),',') as HolidayDates
Resident tempHolidays
where Year([HLDY_DT]) &amp;gt;= '2019';

Let vPublicHolidays = fieldvalue('HolidayDates',1);

drop table tempHolidays;

set vGetHoliday = LastWorkDate(MonthStart(Max(Today(1))), 1, $(vPublicHolidays));

if vGetHoliday = Today(1) then
	Set vHoliDate = 'True';
ELSE
	Set vHoliDate = 'False';
end if;

if (vHoliDate = 'True') or (vBypass1stWorkDayofMonth = 1) Then

       [run some code]
end if;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:47:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/error-with-if-statement-in-load-script/m-p/1595714#M595789</guid>
      <dc:creator>veldetta</dc:creator>
      <dc:date>2019-06-25T13:47:26Z</dc:date>
    </item>
  </channel>
</rss>

