Hi Guys,
I have a data:
Date (DD/MM/YYYY) | Place | Region | Value |
01/08/2020 | 1 | A | 2 |
01/08/2020 | 1 | B | 7 |
01/08/2020 | 2 | C | 4 |
01/08/2020 | 2 | D | 8 |
01/09/2020 | 1 | A | 1 |
01/09/2020 | 1 | A | 9 |
01/09/2020 | 1 | B | 5 |
01/09/2020 | 2 | C | 7 |
01/09/2020 | 2 | C | 3 |
and i transform into pivot
| | 01/08/2020 | 01/09/2020 |
1 | A | 2 | 10 |
| B | 7 | 5 |
2 | C | 4 | 10 |
| D | 8 | - |
I use if(isnull(sum(value)),0,sum(value))-if(isnull(before(sum(value))),0,before(sum(value))) and it gives me value ONLY row A (-8), B (2), C (-6) while D returns to - instead of -8
how to get the difference if there is a null value?
Thank you