Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

peek vs previous

please any one explain the peek and previous

reddy

1 Solution

Accepted Solutions
MVP
MVP

Re: peek vs previous

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.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

2 Replies
Not applicable

peek vs previous

Refer to page No 413 of Qlik View reference manual

MVP
MVP

Re: peek vs previous

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.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica