<?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 Differents results for a same script - weekday() today() functions - Batch mode in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Differents-results-for-a-same-script-weekday-today-functions/m-p/336656#M124155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;today(0) must be used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2012 13:04:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-17T13:04:34Z</dc:date>
    <item>
      <title>Differents results for a same script - weekday() today() functions - Batch mode</title>
      <link>https://community.qlik.com/t5/QlikView/Differents-results-for-a-same-script-weekday-today-functions/m-p/336655#M124154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I need to run a script every wednesdays, therefore I used function weekday and today.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Below a script's extract:&lt;BR /&gt;&lt;EM&gt;LET Jour_Semaine_LIB=weekday(date(today(0),'dd')); &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;LET Jour_Semaine=num(weekday(date(today(0),'dd')));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;trace 'Jour de la semaine : ' $(Jour_Semaine_LIB);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Directory;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//if Wednesday&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if&amp;nbsp; $(Jour_Semaine) = 2 then&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This script is scheduled to run everydays at 08:30am. &lt;BR /&gt;This has been done through the QlikView Web server application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This morning (it is wednesday) I have curious results in the log :&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;04/04/2012 08:32:24: 0053&amp;nbsp; LET Jour_Semaine_LIB=weekday(date(today(0),'dd'))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:32:24: 0054&amp;nbsp; LET Jour_Semaine=num(weekday(date(today(0),'dd')))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:32:24: 0056&amp;nbsp; trace 'Jour de la semaine : ' tuesday&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;04/04/2012 08:32:24: 0056&amp;nbsp; 'Jour de la semaine : ' tuesday&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;04/04/2012 08:32:24: 0060&amp;nbsp; Directory&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:32:24: 0063&amp;nbsp; if&amp;nbsp; 1 = 2 then&lt;/EM&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;BR /&gt;So I rerun manually the script through the QlikView Web server application and have the following log :&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;04/04/2012 08:34:49: 0053 LET Jour_Semaine_LIB=weekday(date(today(0),'dd'))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:34:49: 0054 LET Jour_Semaine=num(weekday(date(today(0),'dd')))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:34:49: 0056 trace 'Jour de la semaine : ' wednesday&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;04/04/2012 08:34:49: 0056 'Jour de la semaine : ' wednesday&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:34:49: 0060 Directory&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:34:49: 0063 if&amp;nbsp; 2 = 2 then&lt;/EM&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;BR /&gt;I rescheduled the same script at 08:45am the same morning (nothing else changed except the time of schedule) and now I have : &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;04/04/2012 08:45:02: 0053&amp;nbsp; LET Jour_Semaine_LIB=weekday(date(today(0),'dd'))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:45:02: 0054&amp;nbsp; LET Jour_Semaine=num(weekday(date(today(0),'dd')))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:45:02: 0056&amp;nbsp; trace 'Jour de la semaine : ' wednesday&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;04/04/2012 08:45:02: 0056&amp;nbsp; 'Jour de la semaine : ' wednesday&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;04/04/2012 08:45:02: 0060&amp;nbsp; Directory&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;04/04/2012 08:45:02: 0063&amp;nbsp; if&amp;nbsp; 2 = 2 then&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do not know what happens here. It seems that batch mode does not execute correctly the today function.&lt;/P&gt;&lt;P&gt;Many thanks in advance for your help,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Gilles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 08:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Differents-results-for-a-same-script-weekday-today-functions/m-p/336655#M124154</guid>
      <dc:creator />
      <dc:date>2012-04-04T08:15:10Z</dc:date>
    </item>
    <item>
      <title>Differents results for a same script - weekday() today() functions - Batch mode</title>
      <link>https://community.qlik.com/t5/QlikView/Differents-results-for-a-same-script-weekday-today-functions/m-p/336656#M124155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;today(0) must be used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 13:04:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Differents-results-for-a-same-script-weekday-today-functions/m-p/336656#M124155</guid>
      <dc:creator />
      <dc:date>2012-04-17T13:04:34Z</dc:date>
    </item>
  </channel>
</rss>

