Good day
Following problem, I can not count the amount of sales at the end of the month in expressions in pivot table
Sum(if(Date=Aggr(Max(Date),Month),Amount,0))
or
Sum(Aggr(FirstSortedValue(Amount,-Date),Month))
it does not work
FirmID
| GoodsID | Date | Amount | Month |
---|
1 | 1 | 01.01.2013 | 5 | Jan |
1 | 2 | 31.01.2013 | 2 | Jan |
1 | 4 | 28.02.2013 | 3 | Feb |
1 | 2 | 28.02.2013 | 1 | Feb |
1 | 1 | 05.03.2013 | 4 | March |