Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone, I need your help.
I have a table with the value of my stock per day
example
Item ID | Year | Month | Day | Date | StockValue |
116 | 2023 | 01 | 01 | 01/01/2023 | 100 |
116 | 2023 | 01 | 31 | 31/01/2023 | 90 |
116 | 2023 | 02 | 02 | 02/02/2023 | 20 |
116 | 2023 | 02 | 27 | 27/02/2023 | 50 |
116 | 2023 | 02 | 14 | 14/03/2023 | 550 |
116 | 2023 | 03 | 31 | 31/03/2023 | 700 |
I am looking for a way to display the last stock value for an item according to the time dimension.
Case 1 )
user select only the year 2023
expect result : 700
Case 2 )
user select the year 2023 and month 02
expect result : 50
Someone can help me pls ?
Hello,
One way to do it would be using set identifier in your expression
For instance :
=Sum({$<[Date_field] ={"$(=Max([Date_field]))"}>)
Basically it will sum every value, grouping by your current selection (represented by $), having the date = to the max date available.
Identifiers can be used when you can aggregate some values, there's this link on the matter :
It takes a bit of practice but it's great once you get the hang of it.
Sorry I missed a part from the expression =Sum({$<[Date_field] ={"$(=Max([Date_field]))"}> [Amount])
So that your amount is summed.