Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Problem with Peek() function - it returns inproper values

Hello everyone,

I have problem with Peek function. I try to create rank (OT_TOIL_RANK) for particular ID ordered by Day column .

LOAD
*,
if(Previous(Key_TOIL_baza) = Key_TOIL_baza, Peek(OT_TOIL_RANK) + 1, 1) as OT_TOIL_RANK
Resident table
order by Key_TOIL_baza, Day ASC;

For two Staff IDs function do not work - it do not assingn any number of rank, it just pass over those IDs:

qlik.PNG

 

Do you have idea why it's happening?

 

 

 

1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

Re: Problem with Peek() function - it returns inproper values

You're missing some single quotes in your Peek, also set row number to retrieve previous row (-1)

I'd also be inclined to change the Previous to a Peek, but that's purely personal preference

if(Peek('Key_TOIL_baza', -1) = Key_TOIL_baza, Peek('OT_TOIL_RANK', -1) + 1, 1) as OT_TOIL_RANK

View solution in original post

2 Replies
Highlighted
Specialist III
Specialist III

Re: Problem with Peek() function - it returns inproper values

You're missing some single quotes in your Peek, also set row number to retrieve previous row (-1)

I'd also be inclined to change the Previous to a Peek, but that's purely personal preference

if(Peek('Key_TOIL_baza', -1) = Key_TOIL_baza, Peek('OT_TOIL_RANK', -1) + 1, 1) as OT_TOIL_RANK

View solution in original post

Highlighted
Contributor
Contributor

Re: Problem with Peek() function - it returns inproper values

Marcus thanks a lot !!