<?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 last invoice date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/last-invoice-date/m-p/617688#M681928</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'm trying to calculate the last invoice date based on a version date (snapshot date).&lt;/P&gt;&lt;P&gt;In order to accomplish this I have loaded both the snapshot dates as well as the detailed inventory movements as seperate tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step is to calculate the last invoice date at each snapshot date and this is where i got stuck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a cartesian product of the version dates and all movements.&lt;/P&gt;&lt;P&gt;In a next step I'm trying to calculate the last invoice date given the version date as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rotation:&lt;/P&gt;&lt;P&gt;load VersionDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Material,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Warehouse,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Date#(InvoiceDate) &amp;lt;= Date#(VersionDate), max(IssueDate),'Unknown') as LastInvoiceDate&lt;/P&gt;&lt;P&gt;Resident VersionDate&lt;/P&gt;&lt;P&gt;group by VersionDate, SSP, Material;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;The result is en 'Error in expression'. Can anyone what is wrong in this statement?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much in advance,&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;K&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps: The difficulty here is that the last invoice date for a certain material at a certain warehouse could be several months earlier than the month of the snapshot but then that still remains the last invoice date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Apr 2014 09:16:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-09T09:16:57Z</dc:date>
    <item>
      <title>last invoice date</title>
      <link>https://community.qlik.com/t5/QlikView/last-invoice-date/m-p/617688#M681928</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'm trying to calculate the last invoice date based on a version date (snapshot date).&lt;/P&gt;&lt;P&gt;In order to accomplish this I have loaded both the snapshot dates as well as the detailed inventory movements as seperate tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step is to calculate the last invoice date at each snapshot date and this is where i got stuck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a cartesian product of the version dates and all movements.&lt;/P&gt;&lt;P&gt;In a next step I'm trying to calculate the last invoice date given the version date as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rotation:&lt;/P&gt;&lt;P&gt;load VersionDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Material,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Warehouse,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Date#(InvoiceDate) &amp;lt;= Date#(VersionDate), max(IssueDate),'Unknown') as LastInvoiceDate&lt;/P&gt;&lt;P&gt;Resident VersionDate&lt;/P&gt;&lt;P&gt;group by VersionDate, SSP, Material;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;The result is en 'Error in expression'. Can anyone what is wrong in this statement?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much in advance,&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;K&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps: The difficulty here is that the last invoice date for a certain material at a certain warehouse could be several months earlier than the month of the snapshot but then that still remains the last invoice date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 09:16:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/last-invoice-date/m-p/617688#M681928</guid>
      <dc:creator />
      <dc:date>2014-04-09T09:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: last invoice date</title>
      <link>https://community.qlik.com/t5/QlikView/last-invoice-date/m-p/617689#M681929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&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;Rotation:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;load&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;max(IssueDate) as &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LastInvoiceDate&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;VersionDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Material,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSP&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Resident VersionDate&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InvoiceDate &amp;lt;= VersionDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;group by VersionDate, SSP, Material;&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;HTH&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 09:20:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/last-invoice-date/m-p/617689#M681929</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2014-04-09T09:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: last invoice date</title>
      <link>https://community.qlik.com/t5/QlikView/last-invoice-date/m-p/617690#M681930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try including SSP in the load like:&lt;/P&gt;&lt;P&gt;Rotation:&lt;/P&gt;&lt;P&gt;load VersionDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;SSP&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Material,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Warehouse,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Date#(InvoiceDate) &amp;lt;= Date#(VersionDate), max(IssueDate),'Unknown') as LastInvoiceDate&lt;/P&gt;&lt;P&gt;Resident VersionDate&lt;/P&gt;&lt;P&gt;group by VersionDate, SSP, Material;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 09:23:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/last-invoice-date/m-p/617690#M681930</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-04-09T09:23:34Z</dc:date>
    </item>
  </channel>
</rss>

