Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to get the latest value every month and plot it in a chart against time.
My data looks like the below,
Date | Sum(Stock) |
---|---|
459 | |
1/8/2016 | 39 |
1/29/2016 | 39 |
1/1/2016 | 42 |
1/22/2016 | 42 |
1/15/2016 | 43 |
2/5/2016 | 43 |
2/19/2016 | 44 |
2/26/2016 | 49 |
2/12/2016 | 53 |
3/5/2016 | 65 |
And i am aware that Sum cannot be used as it is a snapshot of the weekly Stock. I tried using Only , but missing something to complete it. Please help. Attached the sample application here.
Thanks in advance.
May be this:
FirstSortedValue(Aggr(Sum(Stock), Date), -Aggr(Day, Date))
Or if you want to get the stock on the last dates of a month per city:
=Sum(Aggr( FirstSortedValue(Stock,-Date),Country, City,Monthname))
edit: Monthname is a field created in the script
Thanks Sunny
Thanks Stefan.