Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Peek giving me problems

Currently trying to get the Peek function to update a null value in a table based on the same customer having a value on another line, as below, I thought the following code in script would work, but it is not updating it, so just wondering if I am missing anything.

The field name in the script of 'UserField3' is the field in the source database which I have changed the name to 'Their Comment' within the dimensions in Qlikview

Load

MasterID,
UserField3
,

if(isnull(UserField3), peek(UserField3, - 1), 'UserField3'),
if(isnull(UserField3), peek(UserField3, 1), 'UserField3'),

Qlikview Peek.jpg

3 Replies
sasiparupudi1
Master III
Master III

Try like below

Load

MasterID,
UserField3
,

if(Len(Trim((UserField3))=0, peek(UserField3), UserField3') AS MissingUserField3


Resident YourTable

Order By MasterID,UserField3

sunny_talwar

Or you doing order by statement? Also, advice you to check If MasterID = Previous(MasterID)...

olivierrobin
Specialist III
Specialist III

the syntax is :

Peek() finds the value of a field in a table for a row that has already been loaded or that exists in internal

 

Peek (fieldname [ , row [ , tablename ] ]

so for you,

peek(UserField3, - 1,table name)