Forum Discussion

Ludd's avatar
Ludd
New Member
5 years ago
Solved

Dates in columns and variable

Currently, I have an input like below with hundreds of extra columns:

CountryIDInitiativeCostmar-21apr-21
UK111003040
US221501211
IT32201411

 

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?

2 Replies

  • That is a rather unfortunate table design. Have you considered unpivoting your month columns?