<?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: Difference between peek() and previous() funcation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241430#M91855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I decided to test out peek() with concatenate.&amp;nbsp; You can indeed refer to rows that were in the table before you started concatenating.&amp;nbsp; This script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Data:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ID, Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1, 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2, 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;3, 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE (Data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD 4 as ID, peek('Value') as Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE (Data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD ID+4 as ID, peek('Value',-4) as Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT Data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Produced the results I thought it should produce:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ID Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;3&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;4&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;5&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;6&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;7&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;8&amp;nbsp; 3&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 May 2011 17:08:58 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-05-27T17:08:58Z</dc:date>
    <item>
      <title>Difference between peek() and previous() function</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241421#M91846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is difference between peek() and previous() function.&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;Ashish Srivastava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Aug 2010 05:16:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241421#M91846</guid>
      <dc:creator />
      <dc:date>2010-08-04T05:16:53Z</dc:date>
    </item>
    <item>
      <title>Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241422#M91847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashish,&lt;/P&gt;&lt;P&gt;I think the difference between Peek and Previous is that Previous always returns the data present in the previous row of the table but Peek can return data from any row based on the row mentioned in the function.&lt;/P&gt;&lt;P&gt;eg. previous(value) returns the data for 'value' from the previous row&lt;/P&gt;&lt;P&gt;peek(Value,-3) returns the 3rd last record loaded into the table.&lt;/P&gt;&lt;P&gt;previous(value) and peek(value) will return the same record from the previous row&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Haneesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Aug 2010 06:18:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241422#M91847</guid>
      <dc:creator />
      <dc:date>2010-08-04T06:18:51Z</dc:date>
    </item>
    <item>
      <title>Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241423#M91848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Previous looks at your INPUT table. Peek looks at your OUTPUT table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Aug 2010 01:41:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241423#M91848</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-08-05T01:41:16Z</dc:date>
    </item>
    <item>
      <title>Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241424#M91849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Dear John&lt;/P&gt;&lt;P&gt;Thanks for reply .&lt;/P&gt;&lt;P&gt;But I don't understand what is INPUT table and OUTPUT table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashish Srivastava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Aug 2010 08:29:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241424#M91849</guid>
      <dc:creator />
      <dc:date>2010-08-05T08:29:58Z</dc:date>
    </item>
    <item>
      <title>Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241425#M91850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Output is the table you're creating. Input is the table you're reading from.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;OutputTable:&lt;BR /&gt;LOAD field&lt;BR /&gt;RESIDENT InputTable;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Aug 2010 16:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241425#M91850</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-08-05T16:46:38Z</dc:date>
    </item>
    <item>
      <title>Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241426#M91851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank John now i understood.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashish Srivastava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 08:37:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241426#M91851</guid>
      <dc:creator />
      <dc:date>2010-08-06T08:37:27Z</dc:date>
    </item>
    <item>
      <title>Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241427#M91852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi John. If you do a concantenate Load and you use a Peek function in the Load statement, how would this affect the working of Peek? I've just spent a lot of troubleshooting time on some Peeks that would not behave because of the Concatenate qualifier and I'm wondering why. Thanks for your always valuable input!&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (apologies for this being all on one line. for some reason I can't press 'enter' in this edit box &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 08:58:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241427#M91852</guid>
      <dc:creator />
      <dc:date>2011-05-26T08:58:10Z</dc:date>
    </item>
    <item>
      <title>Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241428#M91853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm actually not certain how it would work with a concatenate load.&amp;nbsp; I would think that the peek() should be able to refer to ANY row in the table you're building, even those that existed before you started concatenating the last source of data.&amp;nbsp; But it certainly wouldn't surprise me if I'm wrong.&amp;nbsp; It would almost surprise me more if I'm right.&amp;nbsp; What are you seeing happening?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2011 00:18:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241428#M91853</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-27T00:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241429#M91854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;John - Thank you for the explanation. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;Ashish - The post you had marked answered is not really the answer. It is confusing for other users who want to read this thread. I think it should be John's post which should be the answer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: trebuchet ms,geneva;"&gt;Many thanks - DV&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2011 15:11:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241429#M91854</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2011-05-27T15:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241430#M91855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I decided to test out peek() with concatenate.&amp;nbsp; You can indeed refer to rows that were in the table before you started concatenating.&amp;nbsp; This script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Data:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ID, Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1, 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2, 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;3, 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE (Data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD 4 as ID, peek('Value') as Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE (Data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD ID+4 as ID, peek('Value',-4) as Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT Data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Produced the results I thought it should produce:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ID Value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;3&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;4&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;5&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;6&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;7&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;8&amp;nbsp; 3&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2011 17:08:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241430#M91855</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-27T17:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241431#M91856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your brief explanation,&lt;/P&gt;&lt;P&gt;1.Can i use &lt;STRONG&gt;Peek function&lt;/STRONG&gt; inside into previous function.&lt;/P&gt;&lt;P&gt;2.Can i use &lt;STRONG&gt;previous&amp;nbsp; function&lt;/STRONG&gt; inside into Peek function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 06:55:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241431#M91856</guid>
      <dc:creator />
      <dc:date>2014-01-10T06:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241432#M91857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can use previous() in OUTPUT table like:&lt;/P&gt;&lt;P&gt;OUTPUT:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sales,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Previous(Sales) as Previous_Sales&lt;/P&gt;&lt;P&gt;From table;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Mar 2017 08:59:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241432#M91857</guid>
      <dc:creator>nihhalmca</dc:creator>
      <dc:date>2017-03-05T08:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241433#M91858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please mark it Jhon post as correct answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Mar 2017 09:01:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241433#M91858</guid>
      <dc:creator>nihhalmca</dc:creator>
      <dc:date>2017-03-05T09:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241434#M91859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use previous() while &lt;STRONG&gt;&lt;EM&gt;creating&lt;/EM&gt;&lt;/STRONG&gt; an output table. But previous() &lt;STRONG&gt;&lt;EM&gt;looks at&lt;/EM&gt;&lt;/STRONG&gt; the previous row of the input table, not the previous row in the output table. For instance, you could not use previous(Previous_Sales), because Previous_Sales doesn't exist in the input table. But you could use peek(Previous_Sales), because peek() looks at the output table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:05:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241434#M91859</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2017-03-06T17:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241435#M91860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for explanation John.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However we can use Peek() at INPUT table right, for instance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&lt;/P&gt;&lt;P&gt;From QVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vLastDate&amp;nbsp; = Peek('Date',Table1);&amp;nbsp; //getting record from loaded table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here Table1 is INPUT table right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nihhal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241435#M91860</guid>
      <dc:creator>nihhalmca</dc:creator>
      <dc:date>2017-03-16T15:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between peek() and previous() funcation</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241436#M91861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I probably wouldn't call it input &lt;EM&gt;&lt;STRONG&gt;or&lt;/STRONG&gt;&lt;/EM&gt; output since it isn't in a load statement. But you write a script like the below, and then I would completely agree that peek(X,recno()-2,'Input') is reading the input table, a counterexample to my overly-simplistic pronouncements, and it further seems to be the equivalent of previous(X).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Input:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;X&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; X as InputX&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,X+1 as X&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,recno() as recno&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,rowno() as rowno&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,previous(X) as PrevX&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,peek(X) as PeekX&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,peek(X,recno()-2,'Input') as PeekInputX2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,peek(X,rowno()-2,'Output') as PeekOutputX2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT Input&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHERE X &amp;gt; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP TABLE Input;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the output, and I think this makes sense in terms of what the functions are doing, so I &lt;STRONG&gt;&lt;EM&gt;think&lt;/EM&gt;&lt;/STRONG&gt; it's always true, though I'm not fully confident:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;previous(X) = peek(X,recno()-2,'Input')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;peek(X)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = peek(X,rowno()-2,'Output')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So yes, when we explicitly tell peek() which table to use, it can reference any table we want - input, output, or other. As the help text states it, "If no table_name is stated, the current table is assumed." What I'm trying to drive home about this is that in a load statement, the "current table" is the table you are creating (output), not the data source you are reading data from (input). Previous() would always refer to the data source you are reading from (input), not the table you are creating (output). I think this is where most people are likely to get confused, likely to make mistakes, so it's the point I was pushing. But yes, as you point out, using the third parameter, you can make peek() look at any table, including the input table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peek() on the input table might even be a practical alternative to previous() in some cases. Probably easier to do peek(X,recno()-5,'Input') than previous(previous(previous(previous(X)))). It just seems a little confusing to have -2 go one step back, -5 go four steps back, but that's what happens when functions are defined inconsistently.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;peek(): "0 denotes the first record, 1 the second, and so on."&lt;BR /&gt;recno(): "The first record is number 1."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time for my angry face. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/angry.png" /&gt; Bad Qlik! No cookie! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 21:13:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-peek-and-previous-function/m-p/241436#M91861</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2017-03-16T21:13:33Z</dc:date>
    </item>
  </channel>
</rss>

