Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Peek Function Issue

Hi,

I am having some issue with Peek function.Here I have attached the document.

In short the issue is -

Initial table looks like

NameloginDatelogoutDate
bob

10/01/2011 10.15 AM

bob10/01/2011 10.30 AM
bob10/03/2011 10.45 AM
bob10/03/2011 11.00 AM
bob10/06/2011 11.30 AM


then I used the peek function on loginDate.

Load *,

Name

logoutdate as logout,

peek(loginDate) as login

resident table;

after this the table looked like

nameloginlogout
bob

10/01/2011 10.15 AM

10/01/2011 10.30 AM
bob10/03/2011 10.45 AM10/03/2011 11.00 AM
bob-

The peek function couldn't read the last login record.(as there is no logout for that last login)

can anyone help on this?Peek function reads the previous record.is there a way to read next record in qlikview?

Thanks...

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi Pooja x,

you can indeed read the next record from an already read in input table, like in your sample. peek function takes up to three parameter, with second you can specify the record number and with third the input table.

Try this:

logInOut:

load

Name,

loginDate as login,

peek('logoutDate',recno(),'Final') as logout

resident Final;

recno() starts counting record with 1, but peek the field index with 0, so just a recno() will ask for the next record of the input table.

Regards,

Stefan

View solution in original post

3 Replies
swuehl
MVP
MVP

Hi Pooja x,

you can indeed read the next record from an already read in input table, like in your sample. peek function takes up to three parameter, with second you can specify the record number and with third the input table.

Try this:

logInOut:

load

Name,

loginDate as login,

peek('logoutDate',recno(),'Final') as logout

resident Final;

recno() starts counting record with 1, but peek the field index with 0, so just a recno() will ask for the next record of the input table.

Regards,

Stefan

Not applicable
Author

thank you so much for your time...

Not applicable
Author

Hi,

I hope the attached file will solve u r prupose.

Thanks

Vivek