Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

max date

hello,

I have a table  Doc which contains the history of stock

Doc:

nameProduct,

movementDate,

quantity,

unitPrice,

I want to get the quantity of the last movement of each product in a table

I tried this expression : sum({$<Doc.movementDate={$(=Max(Doc.movementDate))}>}Doc.quantity)

but it affects the same date for all product :s

help plz

1 Solution

Accepted Solutions
sushil353
Master II
Master II

try this:

firstsortedvalue(Doc.quantity,-Doc.movementDate)

View solution in original post

4 Replies
sushil353
Master II
Master II

try this:

firstsortedvalue(Doc.quantity,-Doc.movementDate)

Not applicable
Author

thank u so much

Not applicable
Author

but I don't know if  it gives the the quantity of the max(mouvementDate), I mean the recent one.

Anonymous
Not applicable
Author

hello,

Try this

sum({$<Doc.movementDate={'<=$(=Max(Doc.movementDate))'}>}Doc.quantity)