<?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 problem (from SAP) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760611#M270600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, the problem was that I forgot the single quotes. I should know by now. Thank you for the help. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Mar 2015 09:37:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-21T09:37:05Z</dc:date>
    <item>
      <title>Date comparison problem (from SAP)</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760607#M270596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I extract data related to invoices from SAP (VBRK and VBRP tables). In my transformation application, I include a QVS file with the following code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Set start date for extractions&lt;/P&gt;&lt;P&gt;//After February 15th, we only extract 2 years&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vDateToday= Num(Today());&lt;/P&gt;&lt;P&gt;LET vDateLimit= Num(MakeDate(Year(Today()),'02','15'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF $(vDateToday) &amp;gt; $(vDateLimit) then&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vStartDate = MakeDate(Year(Today())-2,'01','01');&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vStartDate = MakeDate(Year(Today())-3,'01','01');&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, when I create my fact table, I want to only have records where FKDAT &amp;gt;=vStartDate, so my code is like this:&lt;/P&gt;&lt;P&gt;[FactTableSalesReport]:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [InvLine_Sales Document] &amp;amp;'/'&amp;amp; [InvLine_Sales Document Item] AS %OrdLine_Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;Resident [InvoiceAll]&lt;/P&gt;&lt;P&gt;Where [Inv_Billing Date]&amp;gt;= $(vStartDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I still get all the records from my InvoiceAll table, and I don't know why. I made that the field [Inv_Billing Date] was a date field, but if I make a test like If([Inv_Billing Date]&amp;gt;=$(vStartDate),1,0), then it always returns one. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:25:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760607#M270596</guid>
      <dc:creator />
      <dc:date>2015-03-20T15:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison problem (from SAP)</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760608#M270597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, and I also made sure that some records have a [Inv_Billing Date]&amp;lt;$(vStartDate)...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:27:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760608#M270597</guid>
      <dc:creator />
      <dc:date>2015-03-20T15:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison problem (from SAP)</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760609#M270598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I remember, SAP uses YYYYMMDD format for the dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vStartDate = DATE(MakeDate(Year(Today())-2,'01','01'), 'YYYYMMDD');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and don't forget the single quotes:&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;... Where [Inv_Billing Date]&amp;gt;= '$(vStartDate)';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:33:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760609#M270598</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2015-03-20T15:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison problem (from SAP)</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760610#M270599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And as proof of Lucians statement, in your document go to Settings-&amp;gt;Variable Overview and verify the value of vStartDate. It should be in the 40000 ... 50000 range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use the Table Viewer to inspect the [Inv_Billing_Date] field. All values (in the format YYYYMMDD) are larger than vStartDate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:41:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760610#M270599</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-20T15:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date comparison problem (from SAP)</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760611#M270600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, the problem was that I forgot the single quotes. I should know by now. Thank you for the help. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Mar 2015 09:37:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparison-problem-from-SAP/m-p/760611#M270600</guid>
      <dc:creator />
      <dc:date>2015-03-21T09:37:05Z</dc:date>
    </item>
  </channel>
</rss>

