i’m trying to do age analysis on some data and need to do a conditional summation i.e my table is :
ID | Date | Amount |
===+=========+========+
1 | 1/1/10 | 100 |
2 | 1/2/10 | 100 |
3 | 1/5/10 | 100 |
4 | 15/5/10 | 100 |
5 | 20/5/10 | 100 |
Say the date today is 1/6/10 I’d like to sum the amount depending on their age as used in age analysis. i.e i’d like this out
Age | Total
===========+======
<30 days | 300
30-60 days | 0
60-90 days | 0
90 days+ | 200
Essentially its a conditional summation so I want to sum all the values (<30 days, then 30-60 days, then 60-90 days, then 90days+)
You can do: