<?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: Variable Evaluation in the Script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587707#M63060</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is because you don't store it as a dual and Qlik doesn't recognize the 43616 as a date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When Qliks engine recognizes a date automatically, a Date# is not needed. A Date# is used to interpret the dates that Qliks engine is not recognizing and often used as a save option (Because versions of Qlik can differ in handling this). For example, 03062019 is a date, but Qlik does not recognize this and for this you need Date#.&lt;/P&gt;&lt;P&gt;Jordy&lt;/P&gt;&lt;P&gt;Climber&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2019 14:43:22 GMT</pubDate>
    <dc:creator>JordyWegman</dc:creator>
    <dc:date>2019-06-03T14:43:22Z</dc:date>
    <item>
      <title>Variable Evaluation in the Script</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587551#M63057</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;I am a bit puzzled by this and wonder if anyone can explain please:&lt;/P&gt;&lt;P&gt;In the script I use variables to store and pass values e.g.&lt;/P&gt;&lt;P&gt;1 - A date is referenced in a table&lt;/P&gt;&lt;P&gt;2 - This date is passed to a variable using the following:&lt;/P&gt;&lt;P&gt;Let vReportMonthEnd =&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;date(peek('ReportMonthEnd', -1,'ReportMonthLatest'));&lt;/P&gt;&lt;P&gt;3 - This variable is then used later in the script, within another table for comparison purposes&lt;/P&gt;&lt;P&gt;Date('$(vReportMonthEnd)') &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;AS MaxDateClaimId,&lt;/P&gt;&lt;P&gt;The question is, why does the variable needed to be wrapped in single quote marks for it to evaluable properly???&lt;/P&gt;&lt;P&gt;I thought single quote marks were for strings, but this should be a number.&lt;/P&gt;&lt;P&gt;The following does not work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Date($(vReportMonthEnd)) &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;AS MaxDateClaimId,&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Colin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:40:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587551#M63057</guid>
      <dc:creator>colinodonnel</dc:creator>
      <dc:date>2024-11-16T05:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Evaluation in the Script</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587642#M63058</link>
      <description>&lt;P&gt;Good question, Explanation here we go.&lt;/P&gt;&lt;P class="example"&gt;&lt;SPAN class="autonumber"&gt;&lt;SPAN&gt;Example:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="Code"&gt;&lt;SPAN&gt;'03/06/2019' // D/M/Y format&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This string will interpret as string when we have data format as DD/MM/YYYY hence there is no impact to evaluate&lt;/P&gt;&lt;P class="example"&gt;&lt;SPAN class="autonumber"&gt;&lt;SPAN&gt;Example:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="Code"&gt;&lt;SPAN&gt;03/06/2019&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When this string is used as a part of an expression, it will be numerically interpret as&lt;SPAN&gt;&amp;nbsp;3&amp;nbsp;&lt;/SPAN&gt;divided by&lt;SPAN&gt;&amp;nbsp;6&amp;nbsp;&lt;/SPAN&gt;divided by&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;2019.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 13:09:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587642#M63058</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2019-06-03T13:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Evaluation in the Script</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587653#M63059</link>
      <description>&lt;P&gt;Yes,&amp;nbsp;the date passed to the variable is in the format DD/MM/YYYY.&lt;/P&gt;&lt;P&gt;A great explanation. Still a little puzzled by one aspect.&lt;/P&gt;&lt;P&gt;The date format&amp;nbsp;we see is effectively the&amp;nbsp;text element of the underlying&amp;nbsp;field value: &amp;nbsp;dual(text, number), and this is the textual representation of the underlying number e.g.&amp;nbsp; 03/06/2019 is the text interpretation of the number 43616.&lt;/P&gt;&lt;P&gt;Does the dual format not apply to variables?&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp;why is there no need to use Date# in this case.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 13:22:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587653#M63059</guid>
      <dc:creator>colinodonnel</dc:creator>
      <dc:date>2019-06-03T13:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Evaluation in the Script</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587707#M63060</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is because you don't store it as a dual and Qlik doesn't recognize the 43616 as a date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When Qliks engine recognizes a date automatically, a Date# is not needed. A Date# is used to interpret the dates that Qliks engine is not recognizing and often used as a save option (Because versions of Qlik can differ in handling this). For example, 03062019 is a date, but Qlik does not recognize this and for this you need Date#.&lt;/P&gt;&lt;P&gt;Jordy&lt;/P&gt;&lt;P&gt;Climber&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 14:43:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587707#M63060</guid>
      <dc:creator>JordyWegman</dc:creator>
      <dc:date>2019-06-03T14:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Evaluation in the Script</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587718#M63061</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;so hopefully this is right:&lt;/P&gt;&lt;P&gt;The following evaluates as an actual date:&lt;/P&gt;&lt;P&gt;Let vReportMonthEnd =&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;date(peek('ReportMonthEnd', -1,'ReportMonthLatest'));&lt;/P&gt;&lt;P&gt;In the variables box during debug mode, it is evaluated as:&lt;/P&gt;&lt;P&gt;vReportMonthEnd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30/04/2019&amp;nbsp; (Note: no quote marks around DD/MM/YYYY)&lt;/P&gt;&lt;P&gt;Furthermore in the Charts "=IsNum(vReportMonthEnd)" calculates as -1 (true).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, during the script load, the formula:&lt;/P&gt;&lt;P&gt;Date('$(vReportMonthEnd)')&amp;nbsp; is evaluated as Date('30/04/2019').&lt;/P&gt;&lt;P&gt;Qlik Sense in this instance recognises that the string '30/04/2019' is a Date (due to matching the System Variables)&amp;nbsp;so it gets processed as a Date.&lt;/P&gt;&lt;P&gt;Conversely, Date($(vReportMonthEnd)) is evaluated as Date(30/04/2019) which is really Date(0.03715) an evaluates to a date of 01/01/1800.&lt;/P&gt;&lt;P&gt;So perhaps a date of '30-04-2019' might not be recognised.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Colin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 16:25:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-Evaluation-in-the-Script/m-p/1587718#M63061</guid>
      <dc:creator>colinodonnel</dc:creator>
      <dc:date>2019-06-03T16:25:26Z</dc:date>
    </item>
  </channel>
</rss>

