Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
v_ganchev
Contributor II
Contributor II

Last record for dimension with multiple equals values

Table No.Document TypeArticleNeeded QuantityVariant CodeVersion No.
361Article1500VariantCode10
361Article10VariantCode10
51074Article11000VariantCode12
51074Article11000VariantCode12

Hello.
This is example of my table in database.
How it's possible to get the last record for dimension Article column?

The result must be:

ArticleNeed QuantityVariantCode
Article11000VariantCode1

My idea was to use:
set NeedQty = FirstSortedValue('Need Quantity' - 'Version No_');

But when there is the equal Version No. it's showing null.

Thanks!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try =FirstSortedValue( aggr(max([Needed Quantity]),Article,[Version No.]), -aggr([Version No.],[Version No.],Article))

See attached qvw.

 


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

Try =FirstSortedValue( aggr(max([Needed Quantity]),Article,[Version No.]), -aggr([Version No.],[Version No.],Article))

See attached qvw.

 


talk is cheap, supply exceeds demand