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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
daniel3
Contributor
Contributor

Load filter lines by version number

Hi,

I have a data table with sales entries. Each line is identified by a document number and an article number and has a version number (just 1, 2, 3... highest = newest).

I would now like to load only the lines with the highest version numbers for each document-number/article-number combination.

In SQL I am using the following statement to filter what I want. How would I transfer this into a QVD generation script?

SELECT TOP [Document No_]+'::'+No_ as ID, a.[Document No_], Quantity, [Shipment Date], [Amount], No_,*
FROM [Sales Line Archive] as a
join (select [Document No_]+'::'+No_ as ID, max([Version No_]) as max_version FROM [Sales Line Archive]
group by [Document No_]+'::'+No_) as b
on a.[Document No_]+'::'+a.No_ = b.ID and a.[Version No_]=b.max_version


Thanks,

 

Daniel

 

0 Replies