Forum Discussion
Ludd
5 years agoNew Member
Dates in columns and variable
Currently, I have an input like below with hundreds of extra columns:
| Country | ID | Initiative | Cost | mar-21 | apr-21 |
| UK | 1 | 1 | 100 | 30 | 40 |
| US | 2 | 2 | 150 | 12 | 11 |
| IT | 3 | 2 | 20 | 14 | 11 |
How can I, without hard coding the current month (mar-21), identify the total per column which would be for UK = 30 and next month = 40? I need to create a new variable for current month.
That is a rather unfortunate table design. Have you considered unpivoting your month columns?