Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
how can i get the average of the latest value per client per selection?
In the case below the value will be 3,333 if I have the selection: feb 2014
| Client | date | value |
| 1 | 2014-01-01 | 2 |
| 1 | 2014-02-01 | 2 |
| 1 | 2014-02-15 | 3 |
| 1 | 2014-03-08 | 4 |
| 1 | 2014-09-01 | 2 |
| 1 | 2014-10-10 | 3 |
| 3 | 2014-01-01 | 1 |
| 3 | 2014-02-01 | 5 |
| 3 | 2014-02-15 | 4 |
| 3 | 2014-03-08 | 2 |
| 3 | 2014-09-01 | 3 |
| 3 | 2014-10-10 | 1 |
| 3 | 2014-09-01 | 4 |
| 3 | 2014-10-10 | 2 |
| 4 | 2014-02-08 | 3 |
| 4 | 2014-09-01 | 1 |
| 4 | 2014-10-10 | 4 |
| 4 | 2014-09-01 | 5 |
| 4 | 2014-10-10 | 1 |
avg(aggr(firstsortedvalue(value,-date),Client))
avg(aggr(firstsortedvalue(value,-date),Client))
Thank you Gysbert! It solved the problem!