Hi all,
I have a dataset like this (for more countries /cities):
COUNTRY | CITY | PERIOD | VALUE |
ITALY | ROME | H1-2017 | 1 |
ITALY | ROME | H2-2017 | 2 |
ITALY | MILAN | Q1-2017 | 3 |
ITALY | MILAN | Q2-2017 | 4 |
ITALY | ROME | H1-2018 | 5 |
ITALY | ROME | H2-2018 | 6 |
ITALY | MILAN | H1-2018 | 7 |
ITALY | MILAN | H2-2018 | 8 |
.... | .. | .. | .. |
In a pivot like this:
I need to calculate per each COUNTRIES
INDEX: SUM OF
- ALL VALUE FOR ALL PERIODS LIKE 'Q*'.
- ALL H1-2017 VALUES FOR PERIOD H1-2018 and H2-2018
- ALL H1-2017 VALUES FOR H2-2017
and more
I've make a mapping table:
Q1-2017 --> Q1-2017
Q2-2017 --> Q2-2017
H1-2017 --> H1-2018
H1-2017 --> H2-2018
....
...
I can't use a IF solution, How make a formula like this?