<?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 Can you use a date variable in Edit Script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392383#M1157921</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to limit the number of records that I import in Edit Script by using a date variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One table has one record with a date field which I want to use as the variable . The other table has the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table with date record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Module;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM live where Module = 'db';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code with the variable is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; debtor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; debtor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt&lt;/P&gt;&lt;P&gt;From debtor_table where date &amp;gt;= 'variable';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to link the variable to a value that is retrieved in earlier script from a different table?&lt;/P&gt;&lt;P&gt;I notice that there are some system variable names for dates - can I use them as the variable instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jan 2013 23:48:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-03T23:48:02Z</dc:date>
    <item>
      <title>Can you use a date variable in Edit Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392383#M1157921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to limit the number of records that I import in Edit Script by using a date variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One table has one record with a date field which I want to use as the variable . The other table has the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table with date record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Module;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM live where Module = 'db';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code with the variable is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; debtor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; debtor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt&lt;/P&gt;&lt;P&gt;From debtor_table where date &amp;gt;= 'variable';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to link the variable to a value that is retrieved in earlier script from a different table?&lt;/P&gt;&lt;P&gt;I notice that there are some system variable names for dates - can I use them as the variable instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 23:48:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392383#M1157921</guid>
      <dc:creator />
      <dc:date>2013-01-03T23:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use a date variable in Edit Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392384#M1157922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of that u can change both fields as same date format(i.e 'YYYY-MM-DD') then keep as same name to both fields then give the association.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 05:32:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392384#M1157922</guid>
      <dc:creator>khadeer</dc:creator>
      <dc:date>2013-01-04T05:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use a date variable in Edit Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392385#M1157923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, something like this for example. You will need to make sure that the variable gets the same date format as the date field in your second table has. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Module;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM live where Module = 'db';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vDate = peek('date');&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //pick the date value from the last record of table T1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; debtor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; debtor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt&lt;/P&gt;&lt;P&gt;From debtor_table where date &amp;gt;= '$(vDate)';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 10:28:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392385#M1157923</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-01-04T10:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use a date variable in Edit Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392386#M1157924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps, you can try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TableWithDateRecord:&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;DateField&lt;/P&gt;&lt;P&gt;1/4/2013&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let datevariable=('DateField',-1,'TableWithDateRecord');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OtherTable:&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Key,Value,Date&lt;/P&gt;&lt;P&gt;A,10,1/3/2012&lt;/P&gt;&lt;P&gt;B,20,1/2/2013&lt;/P&gt;&lt;P&gt;C,30,1/12/2013&lt;/P&gt;&lt;P&gt;D,40,1/4/2013&lt;/P&gt;&lt;P&gt;E,40,2/4/2013&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * &lt;/P&gt;&lt;P&gt;Resident OtherTable&lt;/P&gt;&lt;P&gt;where Date &amp;lt;$(datevariable);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Khaled&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 14:15:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392386#M1157924</guid>
      <dc:creator />
      <dc:date>2013-01-04T14:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use a date variable in Edit Script?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392387#M1157925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert&lt;/P&gt;&lt;P&gt;I have used coding in Access before but QV is different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 01:07:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-use-a-date-variable-in-Edit-Script/m-p/392387#M1157925</guid>
      <dc:creator />
      <dc:date>2013-01-08T01:07:55Z</dc:date>
    </item>
  </channel>
</rss>

