Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
please any one explain the peek and previous
reddy
Hello Reddy,
A very simple explanation is that Peek() is used to retrieve information already loaded in your datamodel, either in the current table or in any other table.
Names:
LOAD * INLINE [
Name, Code
A, 100
B, 200
C, 300
];
LET vThirdValue = Peek('Name', 2, 'Names'); // will return the third value for field "Name" in table "Names". Table Names must be already loaded.
Previous() is used when loading a table to get the previous record value for the field specified.
Names:
LOAD RecordID,
Code,
Previous(RecordID) AS PreviousID; // stores the previous value for RecordID in a new field called PreviousID
SQL SELECT RecordID, Code
FROM Source;
They are used sometimes together to make accumulations in script. There are a lot of examples in the forums.
Hope this helps.
BI Consultant
Refer to page No 413 of Qlik View reference manual
Hello Reddy,
A very simple explanation is that Peek() is used to retrieve information already loaded in your datamodel, either in the current table or in any other table.
Names:
LOAD * INLINE [
Name, Code
A, 100
B, 200
C, 300
];
LET vThirdValue = Peek('Name', 2, 'Names'); // will return the third value for field "Name" in table "Names". Table Names must be already loaded.
Previous() is used when loading a table to get the previous record value for the field specified.
Names:
LOAD RecordID,
Code,
Previous(RecordID) AS PreviousID; // stores the previous value for RecordID in a new field called PreviousID
SQL SELECT RecordID, Code
FROM Source;
They are used sometimes together to make accumulations in script. There are a lot of examples in the forums.
Hope this helps.
BI Consultant