<?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: Help with Variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-Variables/m-p/195005#M55699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Taj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very basically, what your functions are doing is evaluating the content of the variable when you call them with dollar expansion. So it must be the result of the mathematical operation 1 / 1 / 2001. From there the decimal numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QlikView doesn't have datatypes, and any value is subject to two interpretations: numeric or literal (string), and thus represented as money, num, date, timestamp...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following code. Quoting helps to keep the value as a literal (string in programming languages)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;SET vDateSET = '01/01/2001';&lt;/P&gt;&lt;P&gt;LET vDateLET = '01/01/2001'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 0 to 1 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load '$(vDateSET)' AS DateSET, // this will return the value stored in the variable as is &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date('$(vDateSET)') AS DateSETasDate, // this will return a numeric value, although represented as a date &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vDateLET) AS DateLET, // this evaluates 1/1 = 1 / 2010 = 0,0004997 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date($(vDateLET)) AS DateLETasDate // this returns a numeric, although represented as a date (day 0 for QlikView is 31/12/1899 &lt;/P&gt;&lt;P&gt;AutoGenerate 1; &lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Apr 2011 17:09:33 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-04-01T17:09:33Z</dc:date>
    <item>
      <title>Help with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Variables/m-p/195004#M55698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new to QlikView and find it difficult to understand the variables especially the $ expansion. I have written the below simple script and found the result variaying. I was expecting the dates to be shown as meaning dates but the results are in decimal numbers. Please can some one explain why I am getting mixed results?&lt;/P&gt;&lt;P&gt;set aa = 'a';&lt;/P&gt;&lt;P&gt;set bb = '01/01/2001';&lt;/P&gt;&lt;P&gt;let cc = Date#('01/01/2001');&lt;/P&gt;&lt;P&gt;for i = 0 to 1&lt;/P&gt;&lt;P&gt;TestTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;'Testing' as Col1,&lt;/P&gt;&lt;P&gt;'$(aa)' as Col2,&lt;/P&gt;&lt;P&gt;Date#($(bb)) as Col3,&lt;/P&gt;&lt;P&gt;$(bb) as Col4,&lt;/P&gt;&lt;P&gt;Date#('01/01/2001') as Col5,&lt;/P&gt;&lt;P&gt;$(cc) as Col6,&lt;/P&gt;&lt;P&gt;Date#($(cc)) as Col7&lt;/P&gt;&lt;P&gt;autogenerate i;&lt;/P&gt;&lt;P&gt;next i;&lt;/P&gt;&lt;P&gt;Exit script;&lt;/P&gt;&lt;H4&gt;-----------Results---------&lt;/H4&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-4004_sourceID:4004" /&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 16:39:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Variables/m-p/195004#M55698</guid>
      <dc:creator />
      <dc:date>2011-04-01T16:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Variables/m-p/195005#M55699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Taj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very basically, what your functions are doing is evaluating the content of the variable when you call them with dollar expansion. So it must be the result of the mathematical operation 1 / 1 / 2001. From there the decimal numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QlikView doesn't have datatypes, and any value is subject to two interpretations: numeric or literal (string), and thus represented as money, num, date, timestamp...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following code. Quoting helps to keep the value as a literal (string in programming languages)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;SET vDateSET = '01/01/2001';&lt;/P&gt;&lt;P&gt;LET vDateLET = '01/01/2001'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 0 to 1 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load '$(vDateSET)' AS DateSET, // this will return the value stored in the variable as is &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date('$(vDateSET)') AS DateSETasDate, // this will return a numeric value, although represented as a date &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vDateLET) AS DateLET, // this evaluates 1/1 = 1 / 2010 = 0,0004997 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date($(vDateLET)) AS DateLETasDate // this returns a numeric, although represented as a date (day 0 for QlikView is 31/12/1899 &lt;/P&gt;&lt;P&gt;AutoGenerate 1; &lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 17:09:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Variables/m-p/195005#M55699</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-01T17:09:33Z</dc:date>
    </item>
  </channel>
</rss>

