Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
zekazak
Creator
Creator

Latest record per calendar selection

Hello all,

I've got the situation where I need to get the latest status of the order depending on a calendar dimension selected.

My source table look like this:

Event DateOrderStatus
01/01/2013 12:001111Status1
01/01/2013 13:001111Status2
02/01/2013 12:001111Status3
02/01/2013 13:001111Status4

Then I have a calendar which is linked to Event_Date (Day, Month, Year).

So if user picks the day of 01/01/2013 the result should be like this in the separate table object:

Event DateOrderStatus
01/01/2013 13:001111Status2

if user select a month 01/2013, the result should be like this:

Event DateOrderStatus
02/012013 13:001111Status4

The same result should be also when user doesn't select anything. Just the latest status should be displayed.

My current formula is like this but it works only when I select one specific order id. Once I deselect the order_id to display the data for all orders I'm receiving just null.

=aggr(only({<[Event Date]={"$(=aggr(max(date([Event_Date],'YYYY-MM-DD hh:mm:ss')),Order))"}>} [Status]),Order)

Any help would be much appreciated. Thank you in advance.

~Sergejs

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try creating a straight table chart with dimension Order, then create two expressions:

=Timestamp(max([Event Date]))

and

=FirstSortedValue(Status, -[Event Date])

View solution in original post

2 Replies
swuehl
MVP
MVP

Try creating a straight table chart with dimension Order, then create two expressions:

=Timestamp(max([Event Date]))

and

=FirstSortedValue(Status, -[Event Date])

zekazak
Creator
Creator
Author

Yep, It works. Thank you.