Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
Do you have idea why it's happening?
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
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
Marcus thanks a lot !!