Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Versions of document numbers

Good day,

I've got a list of sales order archives with a number of versions.

How do I write my script to only look at the latest version of each sales order?

Each sales order does not have the same number of versions.

See attached test data.

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Contributor III
Contributor III

Re: Versions of document numbers

Hi  Rani

Please try this code

SalesTB: 

LOAD * INLINE [ 

    SOnumber, VersionNumber, Amount, Date

    SO44,1,40,41607

    SO46,1,50,41722

    SO99,1,30,41798

    SO44,4,80,34677

    SO99,3,70,45368

    SO77,1,50,34748

    SO77,6,400,65799

]; 

 

LatestVersion: 

inner keep load 

    SOnumber, 

    max(VersionNumber) as VersionNumber

resident SalesTB 

group by SOnumber; 

drop table LatestVersion;

xpectedOUT.JPG

TheOutput

the output.JPG

cleveranjos‌ , i got this idea from your post, thanks

View solution in original post

2 Replies
Highlighted
Contributor III
Contributor III

Re: Versions of document numbers

Hi  Rani

Please try this code

SalesTB: 

LOAD * INLINE [ 

    SOnumber, VersionNumber, Amount, Date

    SO44,1,40,41607

    SO46,1,50,41722

    SO99,1,30,41798

    SO44,4,80,34677

    SO99,3,70,45368

    SO77,1,50,34748

    SO77,6,400,65799

]; 

 

LatestVersion: 

inner keep load 

    SOnumber, 

    max(VersionNumber) as VersionNumber

resident SalesTB 

group by SOnumber; 

drop table LatestVersion;

xpectedOUT.JPG

TheOutput

the output.JPG

cleveranjos‌ , i got this idea from your post, thanks

View solution in original post

Highlighted
Employee
Employee

Re: Versions of document numbers

Good to read that, keep in touch!