<?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: ASK.. How to select Last Row Value? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179085#M46058</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; I'm new to qlik view and when I try to retrieve the last record by using peek('field_name',-1) the first 2 rows are retrieved(not the last record is returned).While peek('field_name',0) and peek('field_name',1) are working fine.Please help me out to retrieve the last record only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Mar 2014 07:11:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-03-05T07:11:10Z</dc:date>
    <item>
      <title>ASK.. How to select Last Row Value?</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179081#M46054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, need your help plis &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thank you before,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to select Last Row Value?&lt;/P&gt;&lt;P&gt;this is my case,&lt;/P&gt;&lt;P&gt;plis see the picture below (this is table in SQL)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-2240_sourceID:2240" /&gt;&lt;/P&gt;&lt;P&gt;note &lt;B&gt;NoRek + NoPin&lt;/B&gt; is same as &lt;B&gt;account number&lt;/B&gt;&lt;/P&gt;&lt;P&gt;i want to get lastrow &lt;B&gt;CollectorID.&lt;/B&gt;&lt;/P&gt;&lt;P&gt;in 1 account number have more than 1 collector,&lt;/P&gt;&lt;P&gt;but i just want to get last row collector (which is the uptodate one)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this pic is my Qlikview result,&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-2241_sourceID:2241" /&gt;&lt;/P&gt;&lt;P&gt;because there is two collector ID in that account number, my straigth table can't show the collector ID and collector name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my syntax in edit script&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-2242_sourceID:2242" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plis help..&lt;/P&gt;&lt;P&gt;need urgent..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you so much,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Aug 2010 05:46:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179081#M46054</guid>
      <dc:creator />
      <dc:date>2010-08-30T05:46:40Z</dc:date>
    </item>
    <item>
      <title>ASK.. How to select Last Row Value?</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179082#M46055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think you need to group the data with respect to a calculated field 'NoRek' &amp;amp; 'NoPin' '(Concatenated)' which is same as account number. once grouped, then you have to take it as resident and use PEEK function to check last record for each group.&lt;/P&gt;&lt;P&gt;i can try better if it is possible for you to upload a sample application.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;tresesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Aug 2010 06:19:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179082#M46055</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2010-08-30T06:19:27Z</dc:date>
    </item>
    <item>
      <title>ASK.. How to select Last Row Value?</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179083#M46056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello tresesco,&lt;/P&gt;&lt;P&gt;thanks for your reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have already group norek and nopin,&lt;/P&gt;&lt;P&gt;plis see my last picture,&lt;/P&gt;&lt;P&gt;and what is peek function??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you give me an example of that? i mean the syntax.&lt;/P&gt;&lt;P&gt;give an example of syntax base on my case, just give me you get/understand base on my case, later i will correct it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you so much tresesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Aug 2010 06:39:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179083#M46056</guid>
      <dc:creator />
      <dc:date>2010-08-30T06:39:47Z</dc:date>
    </item>
    <item>
      <title>ASK.. How to select Last Row Value?</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179084#M46057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;say you have grouped table : GPTABLE&lt;/P&gt;&lt;P&gt;Now you can try something like (this is the idea - some modification might require):&lt;/P&gt;&lt;P&gt;load peek(accountnumber) as accountnumber, // previous account number is taken as present&lt;/P&gt;&lt;P&gt;if(peek(accountnumber)&amp;lt;&amp;gt;accountnumber, CollectorID) as LastCollectorID&lt;/P&gt;&lt;P&gt;Resident GPTABLE;&lt;/P&gt;&lt;P&gt;About PEEK function:&lt;/P&gt;&lt;H4&gt;peek&lt;A id="peek" name="peek"&gt;&lt;/A&gt;( fieldname [ , row [ , tablename ] ] )&lt;/H4&gt;&lt;P&gt;Returns the contents of the fieldname in the record specified by row in the input table tablename. Data are fetched from the associative QlikView database.&lt;/P&gt;&lt;P&gt;Fieldname must be given as a string (e.g. a quoted literal).&lt;/P&gt;&lt;P&gt;Row must be an integer. 0 denotes the first record, 1 the second and so on. Negative numbers indicate order from the end of the table. -1 denotes the last record read.&lt;/P&gt;&lt;P&gt;If no row is stated, -1 is assumed.&lt;/P&gt;&lt;P&gt;Tablename is a &lt;A href="http://community.qlik.com/forums/t/Table_labels.htm"&gt;table label&lt;/A&gt; without the ending colon. If no tablename is stated, the current table is assumed. If used outside the load statement or referring to another table, the tablename must be included.&lt;/P&gt;&lt;H2&gt;Examples:&lt;/H2&gt;&lt;P style="margin-left:40px;"&gt;peek( 'Sales' )&lt;BR /&gt;returns the value of Sales in the previous record read ( equivalent to previous( Sales ) ).&lt;/P&gt;&lt;P style="margin-left:40px;"&gt;peek( 'Sales', 2 )&lt;BR /&gt;returns the value of Sales from the third record read from the current input table.&lt;/P&gt;&lt;P style="margin-left:40px;"&gt;peek( 'Sales', -2 )&lt;BR /&gt;returns the value of Sales from the second last record read into the current input table.&lt;/P&gt;&lt;P style="margin-left:40px;"&gt;peek( 'Sales', 0, Tab1 )&lt;BR /&gt;returns the value of Sales from the first record read into the input table labeled Tab1.&lt;/P&gt;&lt;P style="margin-left:40px;"&gt;Load A, B, numsum( B, peek( 'Bsum' ) ) as Bsum...;&lt;BR /&gt;creates an accumulation of B in Bsum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Aug 2010 07:00:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179084#M46057</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2010-08-30T07:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: ASK.. How to select Last Row Value?</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179085#M46058</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; I'm new to qlik view and when I try to retrieve the last record by using peek('field_name',-1) the first 2 rows are retrieved(not the last record is returned).While peek('field_name',0) and peek('field_name',1) are working fine.Please help me out to retrieve the last record only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 07:11:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179085#M46058</guid>
      <dc:creator />
      <dc:date>2014-03-05T07:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Re: ASK.. How to select Last Row Value?</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179086#M46059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H4 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;hi Asia&lt;/H4&gt;&lt;H4 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;peek( fieldname , -1, tablename&amp;nbsp; )&lt;/H4&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;this will give the last Record of table &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 07:14:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179086#M46059</guid>
      <dc:creator />
      <dc:date>2014-03-05T07:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: ASK.. How to select Last Row Value?</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179087#M46060</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; I tried the same but peek(field,-1) retrieves the first 2 records only. I have attached my excel data source and the query I did for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD s.no,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name,&lt;/P&gt;&lt;P&gt;&amp;nbsp; data,week(data) - week(monthend(addmonths(data,-1))) as Weeknumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp; week(data) as week_data,&lt;/P&gt;&lt;P&gt;&amp;nbsp; AddMonths(data,-1) as add_months,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekStart(data) as week_start,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekEnd(data) as week_end, week(monthend(addmonths(data,-1))) as mon_end_add_months_week,&lt;/P&gt;&lt;P&gt;&amp;nbsp; week(AddMonths(data,-1)) as week_add_month,Peek(s.no,0) as fst,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Peek(s.no,1) as sec,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Peek(s.no,-1) as thrd&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\387805\Documents\date_work.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I’m getting first record as ‘fst’,second record as ‘sec’ but ‘thrd’ containing first 2 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Asia Imrana M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 07:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179087#M46060</guid>
      <dc:creator />
      <dc:date>2014-03-05T07:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: ASK.. How to select Last Row Value?</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179088#M46061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I found the cause for the issue. Actually I had loaded all the things in the single table. That is why I couldn’t get the last record. Now I have used the 2 load statements individually to load the fields and getting the nth record from the already loaded table(Sales) not from the current table (C:\......\date_work.xlsx)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD s.no,&lt;/P&gt;&lt;P&gt;     name,&lt;/P&gt;&lt;P&gt;   data,week(data) - week(monthend(addmonths(data,-1))) as Weeknumber,&lt;/P&gt;&lt;P&gt;   week(data) as week_data,&lt;/P&gt;&lt;P&gt;   AddMonths(data,-1) as add_months,&lt;/P&gt;&lt;P&gt;   WeekStart(data) as week_start,&lt;/P&gt;&lt;P&gt;   WeekEnd(data) as week_end, week(monthend(addmonths(data,-1))) as mon_end_add_months_week,&lt;/P&gt;&lt;P&gt;   week(AddMonths(data,-1)) as week_add_month&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\387805\Documents\date_work.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sales1:&lt;/P&gt;&lt;P&gt;   load Peek(s.no,0,'Sales') as fst,&lt;/P&gt;&lt;P&gt;   Peek(s.no,1,'Sales') as sec,&lt;/P&gt;&lt;P&gt;   Peek(s.no,-1,'Sales') as thrd Resident Sales;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works perfect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Asia Sarthar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 07:54:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-How-to-select-Last-Row-Value/m-p/179088#M46061</guid>
      <dc:creator />
      <dc:date>2014-03-05T07:54:29Z</dc:date>
    </item>
  </channel>
</rss>

