Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
v_ganchev
New 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
MVP & Luminary
MVP & Luminary

Re: Last record for dimension with multiple equals values

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

See attached qvw.

 


talk is cheap, supply exceeds demand
1 Reply
MVP & Luminary
MVP & Luminary

Re: Last record for dimension with multiple equals values

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

See attached qvw.

 


talk is cheap, supply exceeds demand