Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am having some issue with Peek function.Here I have attached the document.
In short the issue is -
Initial table looks like
Name | loginDate | logoutDate |
---|---|---|
bob | 10/01/2011 10.15 AM | |
bob | 10/01/2011 10.30 AM | |
bob | 10/03/2011 10.45 AM | |
bob | 10/03/2011 11.00 AM | |
bob | 10/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
name | login | logout |
---|---|---|
bob | 10/01/2011 10.15 AM | 10/01/2011 10.30 AM |
bob | 10/03/2011 10.45 AM | 10/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...
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
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
thank you so much for your time...
Hi,
I hope the attached file will solve u r prupose.
Thanks
Vivek