<?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 Get the next value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207596#M1208783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see below an example of getting next value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Tab1:&lt;BR /&gt;load * inline [&lt;BR /&gt;col1,col2,recordno&lt;BR /&gt;A,20,1&lt;BR /&gt;B,30,2&lt;BR /&gt;C,40,3&lt;BR /&gt;A,50,4&lt;BR /&gt;];&lt;BR /&gt;let v = peek('recordno');&lt;BR /&gt;for i = 1 to $(v)&lt;BR /&gt;let v = lookup('col2','recordno',$(i)+1,'Tab1');&lt;BR /&gt;Tab2:&lt;BR /&gt;load&lt;BR /&gt;recordno,&lt;BR /&gt;col1,&lt;BR /&gt;col2,&lt;BR /&gt;Previous(col2) as prev,&lt;BR /&gt;if(isnull('$(v)'),null(),$(v)) as next&lt;BR /&gt;resident Tab1&lt;BR /&gt;where recordno = $(i);&lt;BR /&gt;next&lt;BR /&gt;drop table Tab1;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Dec 2009 18:26:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-30T18:26:17Z</dc:date>
    <item>
      <title>Get the next value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207594#M1208781</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 read a file with the script.&lt;/P&gt;&lt;P&gt;For each record, I created a new field with the previous value :&lt;/P&gt;&lt;P&gt;Previous( myField ) as Prev_Field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how to create another field with the next value ?&lt;/P&gt;&lt;P&gt;I tried Fieldvalue ( 'myField' , recno() + 1) but without success. Any ideas ? Of course my file is well-sorted.&lt;/P&gt;&lt;P&gt;Thanks very much for your help.&lt;/P&gt;&lt;P&gt;Jean-Jacques&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 17:12:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207594#M1208781</guid>
      <dc:creator />
      <dc:date>2009-12-30T17:12:21Z</dc:date>
    </item>
    <item>
      <title>Get the next value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207595#M1208782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jean-Jacques&lt;/P&gt;&lt;P&gt;Did you experiment with lookup? As you have the Prev_Field in your loaded table it should be something like&lt;/P&gt;&lt;P&gt;lookup('myField', 'Prev_Field', Prev_Field_Value)&lt;/P&gt;&lt;P&gt;Jürg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 17:26:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207595#M1208782</guid>
      <dc:creator />
      <dc:date>2009-12-30T17:26:32Z</dc:date>
    </item>
    <item>
      <title>Get the next value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207596#M1208783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see below an example of getting next value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Tab1:&lt;BR /&gt;load * inline [&lt;BR /&gt;col1,col2,recordno&lt;BR /&gt;A,20,1&lt;BR /&gt;B,30,2&lt;BR /&gt;C,40,3&lt;BR /&gt;A,50,4&lt;BR /&gt;];&lt;BR /&gt;let v = peek('recordno');&lt;BR /&gt;for i = 1 to $(v)&lt;BR /&gt;let v = lookup('col2','recordno',$(i)+1,'Tab1');&lt;BR /&gt;Tab2:&lt;BR /&gt;load&lt;BR /&gt;recordno,&lt;BR /&gt;col1,&lt;BR /&gt;col2,&lt;BR /&gt;Previous(col2) as prev,&lt;BR /&gt;if(isnull('$(v)'),null(),$(v)) as next&lt;BR /&gt;resident Tab1&lt;BR /&gt;where recordno = $(i);&lt;BR /&gt;next&lt;BR /&gt;drop table Tab1;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 18:26:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207596#M1208783</guid>
      <dc:creator />
      <dc:date>2009-12-30T18:26:17Z</dc:date>
    </item>
    <item>
      <title>Get the next value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207597#M1208784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys for your quick answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2009 18:40:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-the-next-value/m-p/207597#M1208784</guid>
      <dc:creator />
      <dc:date>2009-12-30T18:40:44Z</dc:date>
    </item>
  </channel>
</rss>

