Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

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
Champion
Champion

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
Specialist
Specialist
Author

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

Miguel_Angel_Baeyens

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)

tresesco
MVP
MVP

Straight table:

Dimension: Order

Exp1: Date(Max(Date))

Exp2: FirstSortedValue(Quantity, -Date)

Exp3: FirstSortedValue(Status, -Date)

For Min you could adjust.

sunny_talwar

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