Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

Aggr and only?

I started with a table like this.

    

Dim 1Dim 2Dim 5Dim 6Expression
AC2015-01-12SSUM(something)
AC2015-02-13T..
AD2015-04-19U
BE2015-01-03V
BE2015-02-12X

The result I wanted was to get the highest date (Dim 5) over Dim 1 and 2.

With an aggregation like this:

=Date(Aggr(DISTINCT max(Dim 5),Dim 1, Dim 2),'YYYY-MM-DD')

..I got something good to start with:

    

Dim 1Dim 2Dim 5Dim 6Expression
AC2015-02-13SSUM(something)
AC2015-02-13T..
AD2015-04-19U
BE2015-02-12V
BE2015-02-12X

Now to my question - how do I filter Dim 6 so I only get the one that 'connects' to the highest date?

As a result as below?

    

Dim 1Dim 2Dim 5Dim 6Expression
AC2015-02-13TSUM(something)
AD2015-04-19U..
BE2015-02-12X
Tags (1)
5 Replies

Re: Aggr and only?

May be replace Dim6 with this:

=Aggr(FirstSortedValue(Dim6, -Dim5), Dim1, Dim2, Dim5)

=Aggr(FirstSortedValue([Dim 6], -[Dim 5]), [Dim 1], [Dim 2])

Capture.PNG

Re: Aggr and only?

Or just use this as your expression and leave Dim 5 and Dim 6 as is:

=Aggr(FirstSortedValue(Aggr(Sum(something), [Dim 1], [Dim 2], [Dim 5], [Dim 6]), -[Dim 5]), [Dim 1], [Dim 2])


Capture.PNG

Not applicable

Re: Aggr and only?

Thank you, that did the trick.

Not applicable

Re: Aggr and only?

Thank you, but in your example you get the lowest date.

Re: Aggr and only?

Awesome

Community Browser