Hi
My query contains three fields:
Year , Month and amount.
I try to add another column to display the amount calculated last year per month
I tried this formula, but it returns empty:
first I created a new variable calles "last year" = [year]-1
and then I tried to do : [amount] where([year] = [last year] but it returns empty
Example (in red the column that I want to add)
Is it possible?
Year | Month | Amount | Last Year Amount |
2014 | 1 | 10,256 | |
2014 | 2 | 2,135 | |
2014 | 3 | 15,654 | |
2014 | 4 | 2,165 | |
2014 | 5 | 1,321 | |
2014 | 6 | 2,132 | |
2014 | 7 | 2,156 | |
2014 | 8 | 85,682 | |
2014 | 9 | 5,664 | |
2014 | 10 | 2,956 | |
2014 | 11 | 64,253 | |
2014 | 12 | 6,546 | |
2015 | 1 | 54,887 | 10,256 |
2015 | 2 | 84,564 | 2,135 |
2015 | 3 | 5,465 | 15,654 |
2015 | 4 | 12,345 | 2,165 |
2015 | 5 | 1,258 | 1,321 |
2015 | 6 | 25,564 | 2,132 |
2015 | 7 | 1,321 | 2,156 |
2015 | 8 | 84,364 | 85,682 |
2015 | 9 | 1,312 | 5,664 |
2015 | 10 | 13,215 | 2,956 |
2015 | 11 | 21,358 | 64,253 |
2015 | 12 | 135 | 6,546 |
2016 | 1 | 3,121 | 54,887 |
2016 | 2 | 1,321 | 84,564 |
2016 | 3 | 13,213 | 5,465 |
and so on… |