Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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'),
Try like below
Load
MasterID,
UserField3,
if(Len(Trim((UserField3))=0, peek(UserField3), UserField3') AS MissingUserField3
Resident YourTable
Order By MasterID,UserField3
Or you doing order by statement? Also, advice you to check If MasterID = Previous(MasterID)...
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)