<?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 using a variable in load statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183228#M48572</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dino,&lt;/P&gt;&lt;P&gt;If the variable gets in the first place the correct value, then my guess is that you want to do the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LOAD Date($(CoInfoDate)) AS HS.Count_Date, // rest of the fields below&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;That will store the value of the variable in a field named "HS.Count_Date" for each of the records you load.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Nov 2010 17:45:38 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2010-11-11T17:45:38Z</dc:date>
    <item>
      <title>using a variable in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183227#M48571</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've been away from the QlikView environment for a while, but I should think I can remember something as simple as this...&lt;/P&gt;&lt;P&gt;I start off loading a variable from a table like this...&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD&lt;BR /&gt; date(min(Run_Time)) as CoInfoRunDate&lt;BR /&gt; FROM CompanyInfo.xls (biff, embedded labels);&lt;BR /&gt; LET CoInfoDate=peek('CoInfoRunDate',0);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;...then try to use it in my load statement like this...&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD $(CoInfoDate) as HS.Count_Date&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;The initial load and the variable assignment are both working perfectly, but when the table is created, the value for HS.Count_Date comes up as 12/31/1899, which I'm guessing is the date representation for zero. I'm guessing somehow the date at that point is being interpreted as a string with a value of zero but i don't know how to force it to be a date.&lt;/P&gt;&lt;P&gt;Ideas anyone?&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Dino&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 17:38:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183227#M48571</guid>
      <dc:creator />
      <dc:date>2010-11-11T17:38:48Z</dc:date>
    </item>
    <item>
      <title>using a variable in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183228#M48572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dino,&lt;/P&gt;&lt;P&gt;If the variable gets in the first place the correct value, then my guess is that you want to do the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LOAD Date($(CoInfoDate)) AS HS.Count_Date, // rest of the fields below&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;That will store the value of the variable in a field named "HS.Count_Date" for each of the records you load.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 17:45:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183228#M48572</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-11T17:45:38Z</dc:date>
    </item>
    <item>
      <title>using a variable in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183229#M48573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Miguel, but I had already tried date() at all points with no success. What eventually did it was using date#() during the initial load, which established it as a date type early on. Everything else flowed through properly after that.&lt;/P&gt;&lt;P&gt;Apparently, date() only formats a value as a date, but keeps it as a string. Date#() made it a true date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 19:09:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183229#M48573</guid>
      <dc:creator />
      <dc:date>2010-11-11T19:09:47Z</dc:date>
    </item>
    <item>
      <title>using a variable in load statement</title>
      <link>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183230#M48574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome. The thing is that in QlikView there are no datatypes as such. Any value may be either text or numeric, so are dates. The Date() function interprets a numeric value as a date. When this value is not numeric, then Date#() is the way to get it done. That's why you will see several code examples using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Date(Date#(field, 'DDMMYYYY)) AS DateField&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 19:34:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-a-variable-in-load-statement/m-p/183230#M48574</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-11T19:34:32Z</dc:date>
    </item>
  </channel>
</rss>

