Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
irmantas
Contributor III
Contributor III

Max date in expression

Hello,

I have dimensions ItemId, InventLocaionId, ValidateDate, InventBachId, how I can find MAX Transdate in expression, if I need MAX TransDate by InventBachId ?

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

so try this:

=aggr(NODISTINCT Max(Date(TransDate)),InventBachId)

View solution in original post

6 Replies
YoussefBelloum
Champion
Champion

Hi,

can you attach some data ?

you want to display max date on a column as expression or you want to filter with max date inside an expression ?

irmantas
Contributor III
Contributor III
Author

I want show it in column as expression.

YoussefBelloum
Champion
Champion

so if your Transdate column is formatted as a date, you can simply use Max(Transdate), if not, use: Max(Date(Transdate))

irmantas
Contributor III
Contributor III
Author

Some data:

ItemId     InventLocationId     ValidateDate     InventBachId     TransDate

111          A                         12/12/2017          X                    10/12/2017

111          B                         13/12/2017          X                    11/12/2017

111          A                         13/12/2017          X                    12/12/2017

111          A                         20/01/2018          Y                    14/12/2017

I need to find:

ItemId     InventLocationId    InventBachId     MaxTransDate

111          A                         X                    12/12/2017

111          B                         X                    12/12/2017

Excluding InventLocationId MAX TransDate of X is 12/12/2017

YoussefBelloum
Champion
Champion

so try this:

=aggr(NODISTINCT Max(Date(TransDate)),InventBachId)

irmantas
Contributor III
Contributor III
Author

Thank you Youssef