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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Peek based on group

Dear all,

Could you please deliver me a script that can handle in this kind of situation

The desired Output depends on the last score from a series in column 'Score'.

Thanks and best regards,

Cornelis

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Again, sort the data by ID in descending order and then use the Previous function to check the score of the previous record (the next higher ID because of the reversed sort order). You can check for empty strings and null values with Len(Trim( ...something...))=0.

Temp

LOAD

     ID,

     Score

FROM

     ... source ...

     ;

Result:

LOAD

     ID,

     Score,

     If(Len(Trim(Previous(Score)))=0 and Score='K','K') as Output

RESIDENT

     Temp

     ;

DROP TABLE Temp;


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Again, sort the data by ID in descending order and then use the Previous function to check the score of the previous record (the next higher ID because of the reversed sort order). You can check for empty strings and null values with Len(Trim( ...something...))=0.

Temp

LOAD

     ID,

     Score

FROM

     ... source ...

     ;

Result:

LOAD

     ID,

     Score,

     If(Len(Trim(Previous(Score)))=0 and Score='K','K') as Output

RESIDENT

     Temp

     ;

DROP TABLE Temp;


talk is cheap, supply exceeds demand