<?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: Retail data identify the most recent purchase by CustID in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Retail-data-identify-the-most-recent-purchase-by-CustID/m-p/477918#M690623</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll have to make sure the data is loaded in the correct order and then use the peek() function your load script to look at the previous record's value for [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Date of Purchase] and use that for [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;PrevDtOfPur&lt;/SPAN&gt;] .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Bill&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Oct 2013 12:42:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-10-16T12:42:21Z</dc:date>
    <item>
      <title>Retail data identify the most recent purchase by CustID</title>
      <link>https://community.qlik.com/t5/QlikView/Retail-data-identify-the-most-recent-purchase-by-CustID/m-p/477917#M690622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table, CustID, Date of Purchase, ProdID, Quantity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to add few more columns identifying the most recent purchase done by same customer for that ProdID and its quantity.&lt;BR /&gt;This will help me identify number of days since last purchase for a product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the final table should look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="397"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="47"&gt;CustID&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;ProdID&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="73"&gt;DtOfPur&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Quantity&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="85"&gt;PrevDtOfPur&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;PrevQuantity&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;123&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;P1&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;01-01-2013&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;123&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;P2&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;03-04-2013&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;123&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;P1&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;03-04-2013&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;01-01-2013&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;123&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;P2&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;05-06-2013&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;03-04-2013&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;123&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;P3&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;05-06-2013&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I load table to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2013 12:36:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Retail-data-identify-the-most-recent-purchase-by-CustID/m-p/477917#M690622</guid>
      <dc:creator />
      <dc:date>2013-10-16T12:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Retail data identify the most recent purchase by CustID</title>
      <link>https://community.qlik.com/t5/QlikView/Retail-data-identify-the-most-recent-purchase-by-CustID/m-p/477918#M690623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll have to make sure the data is loaded in the correct order and then use the peek() function your load script to look at the previous record's value for [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Date of Purchase] and use that for [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;PrevDtOfPur&lt;/SPAN&gt;] .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Bill&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2013 12:42:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Retail-data-identify-the-most-recent-purchase-by-CustID/m-p/477918#M690623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-16T12:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Retail data identify the most recent purchase by CustID</title>
      <link>https://community.qlik.com/t5/QlikView/Retail-data-identify-the-most-recent-purchase-by-CustID/m-p/477919#M690624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would prefer front-end solution for this using FirstSortedValue() or sometimes Max() with combination of IsNull() in cases like yours.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2013 12:49:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Retail-data-identify-the-most-recent-purchase-by-CustID/m-p/477919#M690624</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-10-16T12:49:03Z</dc:date>
    </item>
  </channel>
</rss>

