Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

find top sequence number per row in QVD

My source qvds have a descending sequence that determines the latest version of the row, for example:

5,a
4,a
3,a
2,a
1,a
4,b
3,b
2,b
1,b
3,c
2,c
1,c
1,d
2,e
1,e


would result in

5,a
4,b
3,c
1,d

2,e

How would I limit the input data to show the current values from the qvd?

James

2 Replies
gussfish
Creator II
Creator II

This would do the trick.

RawData:

LOAD

RecNo() as RecNo,

Number,

Letter

FROM source.csv (txt);

LatestNumberLetters:

LOAD

Number,

Max(RecNo) AS RecNo

Resident RawData;

LEFT JOIN

LOAD

RecNo,

Letter

Resident RawData;

DROP Table RawData;

DROP Field RecNo;

Not applicable
Author

I worked on this for the past couple of days and found that while the question and answer were helpful, the original problem was solved by reading a control record from the database.  Seems I should have done a bit more research on the problem before asking my question.

thanks,
James