<?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 Previous Document Number in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817809#M471363</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We process receipt transactions and i want to display the previous document number.&amp;nbsp; so for eg in the table below, &lt;/P&gt;&lt;P&gt;for&amp;nbsp; Item A, I want to display RCP005 ,&lt;/P&gt;&lt;P&gt;for Item B, I want to display RCP032,&lt;/P&gt;&lt;P&gt;for Item C, I want to display RCP024&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 244px; BORDER-COLLAPSE: collapse;"&gt;&lt;TBODY&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl65" height="20" style="background-color: transparent; width: 64pt; height: 15pt; border: #f0f0f0;" width="85"&gt;&lt;STRONG style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Item&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl65" style="background-color: transparent; width: 119pt; border: #f0f0f0;" width="159"&gt;&lt;STRONG style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Document Number&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP005&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP017&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP012&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP026&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;B&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP032&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP045&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP018&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP024&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP033&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2015 12:28:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-17T12:28:09Z</dc:date>
    <item>
      <title>Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817809#M471363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We process receipt transactions and i want to display the previous document number.&amp;nbsp; so for eg in the table below, &lt;/P&gt;&lt;P&gt;for&amp;nbsp; Item A, I want to display RCP005 ,&lt;/P&gt;&lt;P&gt;for Item B, I want to display RCP032,&lt;/P&gt;&lt;P&gt;for Item C, I want to display RCP024&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 244px; BORDER-COLLAPSE: collapse;"&gt;&lt;TBODY&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl65" height="20" style="background-color: transparent; width: 64pt; height: 15pt; border: #f0f0f0;" width="85"&gt;&lt;STRONG style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Item&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl65" style="background-color: transparent; width: 119pt; border: #f0f0f0;" width="159"&gt;&lt;STRONG style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Document Number&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP005&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP017&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP012&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP026&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;B&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP032&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP045&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP018&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP024&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl66" height="20" style="background-color: transparent; height: 15pt; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="background-color: transparent; border: #f0f0f0;"&gt;&lt;SPAN style="font-family: Calibri; color: #000000; font-size: 12pt;"&gt;RCP033&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 12:28:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817809#M471363</guid>
      <dc:creator />
      <dc:date>2015-03-17T12:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817810#M471364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nayan, if you add a Row number to document number, and they are sorted by Item and Document number, ie for this data:&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *, RowNo() as RowNumber;&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Item,Document Number&lt;/P&gt;&lt;P&gt;A,RCP005&lt;/P&gt;&lt;P&gt;A,RCP017&lt;/P&gt;&lt;P&gt;B,RCP012&lt;/P&gt;&lt;P&gt;B,RCP026&lt;/P&gt;&lt;P&gt;B,RCP032&lt;/P&gt;&lt;P&gt;B,RCP045&lt;/P&gt;&lt;P&gt;C,RCP018&lt;/P&gt;&lt;P&gt;C,RCP024&lt;/P&gt;&lt;P&gt;C,RCP033&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this expression:&lt;/P&gt;&lt;P&gt;FirstSortedValue([Document Number], -RowNumber, 2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 12:39:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817810#M471364</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-03-17T12:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817811#M471365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your prompt reply.&amp;nbsp; Will try it out.&amp;nbsp; Not sure if it will work.&amp;nbsp; Let me just elaborate on my query. When we receive stock, it must show the current documnet number and unit cost.&amp;nbsp; Also on the same line, i want to display what our previous receipt cost and document was. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you understand .&amp;nbsp; if not , i can upload a mock qlikview model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 12:50:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817811#M471365</guid>
      <dc:creator />
      <dc:date>2015-03-17T12:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817812#M471366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, you can use Previous() or Peek() functions. Again you have to start with a table where your data is sorted by type and document number (or by date of that document number)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *, &lt;STRONG&gt;If(Previous(Item)=Item, Previous([Document Number])) as PrevDocument&lt;/STRONG&gt;, RowNo() as RowNumber;&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Item,Document Number&lt;/P&gt;&lt;P&gt;A,RCP005&lt;/P&gt;&lt;P&gt;A,RCP017&lt;/P&gt;&lt;P&gt;B,RCP012&lt;/P&gt;&lt;P&gt;B,RCP026&lt;/P&gt;&lt;P&gt;B,RCP032&lt;/P&gt;&lt;P&gt;B,RCP045&lt;/P&gt;&lt;P&gt;C,RCP018&lt;/P&gt;&lt;P&gt;C,RCP024&lt;/P&gt;&lt;P&gt;C,RCP033&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if this reads an Item equal to the previous Item, it gets the previous document number and saves in PrevDocument field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 13:01:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817812#M471366</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-03-17T13:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817813#M471367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&amp;nbsp;&amp;nbsp; Unfortuantely ,&amp;nbsp; In my actual database , is not sorted by type and document number.&amp;nbsp; Will have a try at your formula and will let you know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 13:33:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817813#M471367</guid>
      <dc:creator />
      <dc:date>2015-03-17T13:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817814#M471368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nayan, if you have some kind of date or another field to give you wich order should be for [Document Number] or if this [Document Number] is the current order you can do something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: // Your current load&lt;/P&gt;&lt;P&gt;LOAD...&lt;/P&gt;&lt;P&gt;Select....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PrevDocuments:&lt;/P&gt;&lt;P&gt;LOAD Item,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Document number],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Previous(Item)=Item, Previous([Document Number])) as PrevDocument&lt;/P&gt;&lt;P&gt;Resident data order by Item, [Document number];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (data) LOAD * Resident PrevDocuments;&lt;/P&gt;&lt;P&gt;DROP Table PrevDocuments;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's only one record for each Item and document number it should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 13:43:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817814#M471368</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-03-17T13:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817815#M471369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you .&amp;nbsp; Will try it out.&amp;nbsp; Much appreciated. By the way, this is the first time im aware of the "Previous function" .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 14:21:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817815#M471369</guid>
      <dc:creator />
      <dc:date>2015-03-17T14:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817816#M471370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your scripting worked fine. Thank you. &lt;/P&gt;&lt;P&gt;Sorry for the delayed reply, I left for home.&lt;/P&gt;&lt;P&gt;Just one more question, in my actual Qlikivew model, I have unit cost per receipt per item. How do i link this unit cost&amp;nbsp; to the "previous document".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for eg, for &lt;STRONG&gt;item C&lt;/STRONG&gt;, for each receipt below there is a unit cost&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RCP018&amp;nbsp; - $20.00&lt;/P&gt;&lt;P&gt;RCP024 - $22.00&lt;/P&gt;&lt;P&gt;RCP033 - $25.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the result i would like to achieve is RCP024 with unit cost of $22.00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 08:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817816#M471370</guid>
      <dc:creator />
      <dc:date>2015-03-18T08:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817817#M471371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nayan, it should be:&lt;/P&gt;&lt;P&gt;data: // Your current load&lt;/P&gt;&lt;P&gt;LOAD...&lt;/P&gt;&lt;P&gt;Select....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PrevDocuments:&lt;/P&gt;&lt;P&gt;LOAD Item,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Document number],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Previous(Item)=Item, Previous([Document Number])) as PrevDocument,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Previous(Item)=Item, Previous([Unit Cost])) as PrevUnitCost,&lt;/P&gt;&lt;P&gt;Resident data order by Item, [Document number];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (data) LOAD * Resident PrevDocuments;&lt;/P&gt;&lt;P&gt;DROP Table PrevDocuments;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 08:13:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817817#M471371</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-03-18T08:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Document Number</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817818#M471372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked.&amp;nbsp; Thank you so much for your help.&amp;nbsp; Much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 08:35:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Document-Number/m-p/817818#M471372</guid>
      <dc:creator />
      <dc:date>2015-03-18T08:35:47Z</dc:date>
    </item>
  </channel>
</rss>

