Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
markp201
Creator III
Creator III

Peek or previous...

rownumCounterNeed
Qlik does this
1000
2100
3201
4311
5101
6211
7000

I want to flag the rows where peek(counter)<counter but the last column is what qlik does instead.

This load is reading a resident table.  not sure if that makes a difference\

Thanks

1 Reply
Nicole-Smith

This returns your desired results:

Data:

LOAD * INLINE [

    rownum, Counter

    1, 0

    2, 1

    3, 2

    4, 3

    5, 1

    6, 2

    7, 0

];

Test:

LOAD rownum, Counter, IF(PEEK(Counter) < Counter, 1, 0) as peek

RESIDENT Data

ORDER BY rownum DESC, Counter DESC;

DROP TABLE Data;

rownum Counter peek
100
210
320
431
510
621
700

I've also attached an example file.