<?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: Date Variable in Where clause in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583369#M682289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sahas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you're pretty much there, you just need dollar-expansion around the variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vCutoffDate = makedate(2013&lt;SPAN style="color: #ff0000;"&gt;,10,30&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;[Invoice Date], [Standard Invoice Qty], [Invoice Amount], [Cost Value], [Invoice #]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sales.QVD (qvd) WHERE [Invoice Date] &amp;gt;= &lt;SPAN style="color: #ff0000;"&gt;'$(&lt;/SPAN&gt;vCutoffDate&lt;SPAN style="color: #ff0000;"&gt;)'&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;However, using the WHERE clause here will break the optimised QVD load.&amp;nbsp; You may want to think about pre-loading all possible dates greater than your variable, then using WHERE EXISTS([Invoice Date]) to keep the load optimised.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this helps,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Feb 2014 09:22:05 GMT</pubDate>
    <dc:creator>Jason_Michaelides</dc:creator>
    <dc:date>2014-02-28T09:22:05Z</dc:date>
    <item>
      <title>Date Variable in Where clause in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583368#M682286</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;/P&gt;&lt;P&gt;I need to put a where clause in load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;LET vCutoffDate = makedate(2013);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[Invoice Date], [Standard Invoice Qty], [Invoice Amount], [Cost Value], [Invoice #]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Sales.QVD (qvd) WHERE [Invoice Date] &amp;gt;= vCutoffDate ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to achieve this ? Your help is badly needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : I do not want to change the SQL which is used to get data from DB using Select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sahas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 09:13:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583368#M682286</guid>
      <dc:creator />
      <dc:date>2014-02-28T09:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Date Variable in Where clause in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583369#M682289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sahas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you're pretty much there, you just need dollar-expansion around the variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vCutoffDate = makedate(2013&lt;SPAN style="color: #ff0000;"&gt;,10,30&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;[Invoice Date], [Standard Invoice Qty], [Invoice Amount], [Cost Value], [Invoice #]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sales.QVD (qvd) WHERE [Invoice Date] &amp;gt;= &lt;SPAN style="color: #ff0000;"&gt;'$(&lt;/SPAN&gt;vCutoffDate&lt;SPAN style="color: #ff0000;"&gt;)'&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;However, using the WHERE clause here will break the optimised QVD load.&amp;nbsp; You may want to think about pre-loading all possible dates greater than your variable, then using WHERE EXISTS([Invoice Date]) to keep the load optimised.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this helps,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 09:22:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583369#M682289</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2014-02-28T09:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Date Variable in Where clause in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583370#M682292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px;"&gt;Sales.QVD (qvd) WHERE [Invoice Date] &amp;gt;= '$(vCutoffDate)' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 09:22:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583370#M682292</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-02-28T09:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date Variable in Where clause in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583371#M682294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;try this in load &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px;"&gt;&lt;STRONG&gt;WHERE [Invoice Date] &amp;gt;= $(vCutoffDate);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 09:24:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583371#M682294</guid>
      <dc:creator />
      <dc:date>2014-02-28T09:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Date Variable in Where clause in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583372#M682295</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;/P&gt;&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 09:28:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Variable-in-Where-clause-in-load-script/m-p/583372#M682295</guid>
      <dc:creator />
      <dc:date>2014-02-28T09:28:55Z</dc:date>
    </item>
  </channel>
</rss>

