Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
ilanbaruch
Contributor III

FirstSortedValue with Aggr

hi all,

i have an aggr expresion which retrives Status dates,

=DATE(aggr(status_date,order),'DD/MM/YYYY')

i want to retrive the min date value

tried it with:

FirstSortedValue(status_date, aggr(status_date,order))

any ideas?

advanced thanks

5 Replies
YoussefBelloum
Esteemed Contributor

Re: FirstSortedValue with Aggr

Hi,

would you be able to share with us more details on this ?

what you have so far and what is the expected output ?

ilanbaruch
Contributor III

Re: FirstSortedValue with Aggr

orderdatequantityStatus
1-966010022/04/2018
175
1-966010023/04/2018
175
1-966010024/04/2018
175
1-966010025/04/2018
175

i need to retrive only one row whith the min/max date

Re: FirstSortedValue with Aggr

Did you try?

FirstSortedValue(order, -date)

With the "-" before the date to get the highest value (most recent date) or without it for the opposite (oldest date)

MVP
MVP

Re: FirstSortedValue with Aggr

Straight table:

Dimension: Order

Exp1: Date(Max(Date))

Exp2: FirstSortedValue(Quantity, -Date)

Exp3: FirstSortedValue(Status, -Date)

For Min you could adjust.

Re: FirstSortedValue with Aggr

If the Quantity and  Status are always the same across all dates, then you can also use Only(Quantity) and Only(Status), but this might be only true in the sample, but just to throw out an option