<?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 Comparing each record of a field and creating a new field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187390#M626429</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 want to compare the records of a field and derive a new field based on the comparison.&lt;/P&gt;&lt;P&gt;Below is sample table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input_Table:&lt;/P&gt;&lt;P&gt;Unique_value, Text&lt;/P&gt;&lt;P&gt;10,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/P&gt;&lt;P&gt;20, P&lt;/P&gt;&lt;P&gt;10, B&lt;/P&gt;&lt;P&gt;10, C&lt;/P&gt;&lt;P&gt;20, Q&lt;/P&gt;&lt;P&gt;10, D&lt;/P&gt;&lt;P&gt;20, R&lt;/P&gt;&lt;P&gt;30, X&lt;/P&gt;&lt;P&gt;20, S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The desired table should look like this-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output_Table:&lt;/P&gt;&lt;P&gt;Unique_value, New_Text&lt;/P&gt;&lt;P&gt;10, A&lt;/P&gt;&lt;P&gt;10, AB&lt;/P&gt;&lt;P&gt;10, ABC&lt;/P&gt;&lt;P&gt;10, ABCD&lt;/P&gt;&lt;P&gt;20, P&lt;/P&gt;&lt;P&gt;20, PQ&lt;/P&gt;&lt;P&gt;20, PQR&lt;/P&gt;&lt;P&gt;20, PQRS&lt;/P&gt;&lt;P&gt;30,X&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not looking for hard-code solution as it could be derived easily through if-else or case statements. Please provide a generic solution.&lt;/P&gt;&lt;P&gt;Any help in approaching this problem will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Sep 2016 05:46:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-09-19T05:46:45Z</dc:date>
    <item>
      <title>Comparing each record of a field and creating a new field</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187390#M626429</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 want to compare the records of a field and derive a new field based on the comparison.&lt;/P&gt;&lt;P&gt;Below is sample table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input_Table:&lt;/P&gt;&lt;P&gt;Unique_value, Text&lt;/P&gt;&lt;P&gt;10,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/P&gt;&lt;P&gt;20, P&lt;/P&gt;&lt;P&gt;10, B&lt;/P&gt;&lt;P&gt;10, C&lt;/P&gt;&lt;P&gt;20, Q&lt;/P&gt;&lt;P&gt;10, D&lt;/P&gt;&lt;P&gt;20, R&lt;/P&gt;&lt;P&gt;30, X&lt;/P&gt;&lt;P&gt;20, S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The desired table should look like this-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output_Table:&lt;/P&gt;&lt;P&gt;Unique_value, New_Text&lt;/P&gt;&lt;P&gt;10, A&lt;/P&gt;&lt;P&gt;10, AB&lt;/P&gt;&lt;P&gt;10, ABC&lt;/P&gt;&lt;P&gt;10, ABCD&lt;/P&gt;&lt;P&gt;20, P&lt;/P&gt;&lt;P&gt;20, PQ&lt;/P&gt;&lt;P&gt;20, PQR&lt;/P&gt;&lt;P&gt;20, PQRS&lt;/P&gt;&lt;P&gt;30,X&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not looking for hard-code solution as it could be derived easily through if-else or case statements. Please provide a generic solution.&lt;/P&gt;&lt;P&gt;Any help in approaching this problem will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2016 05:46:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187390#M626429</guid>
      <dc:creator />
      <dc:date>2016-09-19T05:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing each record of a field and creating a new field</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187391#M626430</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&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Unique_value, Text&lt;/P&gt;&lt;P&gt;10, A&lt;/P&gt;&lt;P&gt;20, P&lt;/P&gt;&lt;P&gt;10, B&lt;/P&gt;&lt;P&gt;10, C&lt;/P&gt;&lt;P&gt;20, Q&lt;/P&gt;&lt;P&gt;10, D&lt;/P&gt;&lt;P&gt;20, R&lt;/P&gt;&lt;P&gt;30, X&lt;/P&gt;&lt;P&gt;20, S&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;Resident Table1&lt;/P&gt;&lt;P&gt;Order By Unique_value , Text asc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Table3:&lt;/P&gt;&lt;P&gt;LOAD*, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Unique_value &amp;lt;&amp;gt; Previous(Unique_value), Text,&amp;nbsp; Peek('TextAdded')&amp;amp; Text) AS TextAdded;&lt;/P&gt;&lt;P&gt;Load * &lt;/P&gt;&lt;P&gt;Resident Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Table2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2016 17:06:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187391#M626430</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-09-19T17:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing each record of a field and creating a new field</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187392#M626431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You solution can be simplified by removing Table2. I think in general it is helpful to avoid unnecessary resident loads&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Unique_value, Text&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10, A&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;20, P&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10, B&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10, C&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;20, Q&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10, D&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;20, R&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;30, X&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;20, S&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Unique_value &amp;lt;&amp;gt; Previous(Unique_value), Text,&amp;nbsp; Peek('TextAdded')&amp;amp; Text) AS TextAdded;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load *&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order By Unique_value , Text;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop Table Table1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/137965_Capture.PNG" style="height: auto;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to sort by text and follow the actual order of Text, then this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Unique_value, Text&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;10, A&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;20, P&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;10, B&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;10, C&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;20, Q&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;10, D&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;20, R&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;30, X&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;20, S&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Table2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Unique_value &amp;lt;&amp;gt; Previous(Unique_value), Text,&amp;nbsp; Peek('TextAdded')&amp;amp; Text) AS TextAdded;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Load *&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Resident Table1&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Order By Unique_value;&lt;SPAN style="color: #ff0000;"&gt; //Remove Text from the order by here&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Drop Table Table1;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 02:05:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187392#M626431</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-20T02:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing each record of a field and creating a new field</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187393#M626432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh Yes, I got that, but was little lazy to revamp the code. Just copied and pasted. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; later realized. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 02:17:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187393#M626432</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-09-20T02:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing each record of a field and creating a new field</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187394#M626433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny and Nagaraju, it worked.&lt;/P&gt;&lt;P&gt;Can you please explain the below statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; IF(Unique_value &amp;lt;&amp;gt; Previous(Unique_value), Text,&amp;nbsp; Peek('TextAdded')&amp;amp; Text) AS TextAdded&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1. How can the field 'TextAdded' is used inside the Peek() before it gets created.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;2. I understood the rest of the logic of using the preceding load and the condition to compare the previous record values.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Please revert for the clarification.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 06:03:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187394#M626433</guid>
      <dc:creator />
      <dc:date>2016-09-20T06:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing each record of a field and creating a new field</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187395#M626434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not know if this explanation helps, probably sunny can put it in simple words if this doesnt help !!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peek() is a Inter record function where it pulls records from previously loaded data. So it accumulates the information from Text field and puts the field value into that TextAdded Field and reiterates record by record and appends with Text field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See Peek() example from Reference manual. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor48"&gt;&lt;/A&gt;&lt;A name="peek"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;peek(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;fieldname [ , row [ , tablename ] ] &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Returns the contents of the &lt;SPAN class="Italic"&gt;fieldname&lt;/SPAN&gt; in the record specified by &lt;SPAN class="Italic"&gt;row&lt;/SPAN&gt; in the internal table &lt;SPAN class="Italic"&gt;tablename&lt;/SPAN&gt;. Data are fetched from the associative QlikView database. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Fieldname&lt;/SPAN&gt; must be given as a string (e.g. a quoted literal). &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Row&lt;/SPAN&gt; 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 &lt;SPAN class="Italic"&gt;row&lt;/SPAN&gt; is stated, -1 is assumed. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Tablename&lt;/SPAN&gt; is a table label, see &lt;A class="MCXref_0"&gt;&lt;EM&gt;Table Labels&lt;/EM&gt;&lt;/A&gt;, without the ending colon. If no &lt;SPAN class="Italic"&gt;tablename&lt;/SPAN&gt; 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;P class="example"&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;peek( 'Sales' )&lt;/SPAN&gt; &lt;BR /&gt;returns the value of &lt;SPAN class="Italic"&gt;Sales&lt;/SPAN&gt; in the previous record read ( equivalent to &lt;SPAN class="Bold"&gt;previous(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;Sales&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;) &lt;/SPAN&gt;). &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;peek( 'Sales', 2 )&lt;/SPAN&gt; &lt;BR /&gt;returns the value of &lt;SPAN class="Italic"&gt;Sales&lt;/SPAN&gt; from the third record read from the current internal table. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;peek( 'Sales', -2 )&lt;/SPAN&gt; &lt;BR /&gt;returns the value of &lt;SPAN class="Italic"&gt;Sales&lt;/SPAN&gt; from the second last record read into the current internal table. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;peek( 'Sales', 0, 'Tab1' )&lt;/SPAN&gt; &lt;BR /&gt;returns the value of &lt;SPAN class="Italic"&gt;Sales&lt;/SPAN&gt; from the first record read into the input table labeled Tab1. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;Load A, B, numsum( B, peek( 'Bsum' ) ) as Bsum...;&lt;/SPAN&gt; &lt;BR /&gt;creates an accumulation of B in Bsum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 16:02:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187395#M626434</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-09-20T16:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing each record of a field and creating a new field</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187396#M626435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this helps?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iteration1: &lt;/P&gt;&lt;P&gt;IF(Unique_value &amp;lt;&amp;gt; Previous(Unique_value), Text,&amp;nbsp; Peek('TextAdded')&amp;amp; Text) AS TextAdded --&amp;gt; TextAdded = A because the If statement fails and First text value is stored in TextAdded&lt;/P&gt;&lt;P&gt;Iteration2: &lt;/P&gt;&lt;P&gt;IF(Unique_value &amp;lt;&amp;gt; Previous(Unique_value), Text,&amp;nbsp; Peek('TextAdded')&amp;amp; Text) AS TextAdded --&amp;gt; TextAdded = AB as prev value is same it will pick the next text value and appends the textadded&lt;/P&gt;&lt;P&gt;Iteration3: ........ and so on. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 16:10:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187396#M626435</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-09-20T16:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing each record of a field and creating a new field</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187397#M626436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for drilling down to the exact logic.&lt;/P&gt;&lt;P&gt;The 2nd logic really helped in understanding the flow and with that the first iteration will always be false.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anuj Koshti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 16:20:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-each-record-of-a-field-and-creating-a-new-field/m-p/1187397#M626436</guid>
      <dc:creator />
      <dc:date>2016-09-20T16:20:40Z</dc:date>
    </item>
  </channel>
</rss>

