Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

avastani
Contributor II

how to view the next record in a resident table during load

I have loaded a table from a data source.

Now I want to perform some transformations whereby I need to know the value of the next record to add new fields. I know PEEK lets me go back, but is there anything that I can see 1 record ahead?

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

how to view the next record in a resident table during load

You can look ahead using peek(). peek() row is 0 based and recno() is 1 based, so it's easy to look ahead one record like this:

data:
LOAD * INLINE [
X
A
B
C
]
;
data2:
LOAD
X,
peek('X', recno(), 'data') as Y
RESIDENT data
;


-Rob

5 Replies
Not applicable

how to view the next record in a resident table during load

Order it the other way around and use Peek :-)

avastani
Contributor II

how to view the next record in a resident table during load

that's what i am trying but thought there must be a better way. i want to avoid multiple loads of the same table to be able to do one thing.

MVP & Luminary
MVP & Luminary

how to view the next record in a resident table during load

You can look ahead using peek(). peek() row is 0 based and recno() is 1 based, so it's easy to look ahead one record like this:

data:
LOAD * INLINE [
X
A
B
C
]
;
data2:
LOAD
X,
peek('X', recno(), 'data') as Y
RESIDENT data
;


-Rob

avastani
Contributor II

how to view the next record in a resident table during load

that is it. i was playing around with it but didn't know how to use it. problem SOLVED! thanks.

Not applicable

Re: how to view the next record in a resident table during load

I am trying the above code,

but it is really not working in my case

This is the excel table I created

ZC
3a
5b
4c
8d
7e

This the script

data:

LOAD Z,

     C,

     peek('Z',recno(),'data') as PEEK

In column PEEK  I end up with all fields marked with '-'

thank you!