<?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 comparison on load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361887#M1178253</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi , Many thanks for your help - something tells me I have a lot to learn !Regards,Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Mar 2012 13:27:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-22T13:27:30Z</dc:date>
    <item>
      <title>Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361878#M1178244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; Hi everybody , I'm trying to load order data with a due date &amp;gt;= to today without much success. In my coding I already reformat the due date which is in CYYMMDD format to YYMMDD using &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;date(date#(right(DUEDT,6),'YYMMDD'),'DDMMYYYY') as Due, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;If I try and use the same code to load only the records I require I get an error on the date# &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000; font-size: 10pt;"&gt;FROM AS400.AMFLIB.POHISTI where (date(date#(right(DUEDT,6),'YYMMDD'),'DDMMYYYY')) &amp;gt;= Today() and INVFG='1' and STAIC&amp;lt;'50' ;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt; Is this the correct way to do this or can the variable created earlier be used to selct data ?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;Many thanks in advance,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;Simon&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 08:41:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361878#M1178244</guid>
      <dc:creator />
      <dc:date>2012-03-21T08:41:25Z</dc:date>
    </item>
    <item>
      <title>Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361879#M1178245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can you post the complete query?Also Which database are you using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 09:03:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361879#M1178245</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-03-21T09:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361880#M1178246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi - you're not going to like seeing the whole query , it's a real mess as I'm a complete novice ! We are using MAPICS on an iSeries. All the dates are CYYMMDD so need converting for easy reading. I have already converted a Due Date ok , but if I use the same code to select Due Dates from Today , I get an error saying date# not found in the database.Regards,Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 09:45:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361880#M1178246</guid>
      <dc:creator />
      <dc:date>2012-03-21T09:45:54Z</dc:date>
    </item>
    <item>
      <title>Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361881#M1178247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I'm using personal edition i cann't open your file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; But in error itself it looks like your using Date# function in select query but which is a qlikview function.To limit the date based on today you have to look functions provided in that database.What DB vendor is yours?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 10:00:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361881#M1178247</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-03-21T10:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361882#M1178248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi , MAPICS is licensed by Infor. Can you use a variable which has been created from the date to select on the load , or does it have to be a database field ? Regards,Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 10:05:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361882#M1178248</guid>
      <dc:creator />
      <dc:date>2012-03-21T10:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361883#M1178249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi , would it be better practice to load all records and then just include the records I need in the table ? Where/how would I do this , as an expression using the date function use previously ? Regards,Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 11:44:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361883#M1178249</guid>
      <dc:creator />
      <dc:date>2012-03-21T11:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361884#M1178250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not having seen the whole query I can;t be sure, but it looks like you are trying to use the second Date/Date# expression in the SQL SELECT. The contents of the SQL SELECT are executed by the DBMS, not Qlikview, so they need to be in the correct format for MAPICS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you mean by CYYMMDD format. Is this 7 digits, or is it the same as YYYYMMDD?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would try is to create a variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vTodayMP = Right(Date(Today(), 'YYYYMMDD'), 7)&amp;nbsp; // asuming&amp;nbsp; 7 digits&lt;/P&gt;&lt;P&gt;Let vTodayMP = Date(Today(), 'YYYYMMDD');&amp;nbsp; // assuming 8 digits &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can use a variable expansion in the SQL query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM AS400.AMFLIB.POHISTI where DUEDT &amp;gt;= '$(vTodayMP)' and INVFG='1' and STAIC&amp;lt;'50' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 12:11:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361884#M1178250</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-03-21T12:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361885#M1178251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Jonathan , the date format we use ( from MAPICS on an iSeries ) is CYYMMDD - where C = 1 for dates 2000 onwards. So todays date is 1120321. So I either need to find a way of stripping off the century and comparing it or prefixing todays date with a 1. Regards,Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 12:48:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361885#M1178251</guid>
      <dc:creator />
      <dc:date>2012-03-21T12:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361886#M1178252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can still use the approach that I outlined, just define the variable in the Let statement in a way that is compatible with the CYYMMDD format. For example, if the application does not need to reference dates outside the current century:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;Let vTodayMP = '1' &amp;amp; Date(Today(), 'YYMMDD'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;or more generallly, you may need (if I understand the format correctly)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;Let vTodayMP =&amp;nbsp; (int(Year(Today())/100) - 19)&amp;nbsp; &amp;amp; Date(Today(), 'YYMMDD'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use this variable as described before&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 20:17:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361886#M1178252</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-03-21T20:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison on load</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361887#M1178253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi , Many thanks for your help - something tells me I have a lot to learn !Regards,Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 13:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-on-load/m-p/361887#M1178253</guid>
      <dc:creator />
      <dc:date>2012-03-22T13:27:30Z</dc:date>
    </item>
  </channel>
</rss>

