TheMacroNoob
Board Regular
- Joined
- Aug 5, 2022
- Messages
- 52
- Office Version
- 365
- Platform
- Windows
Hello all,
See table for example data set. I have transformed 2 files, one "Actual", one "Budget", and they are appended. How do I unpivot the "Source.Name" column in a way where I have two columns, "Actual" and "Budget", their corresponding value for GL Code, GL Name, and Cost Center? I will provide example below the data.
Data:
Desired Result:
I appreciate any instruction you come up with!
Worst case it can be done in two queries, merged, adding custom columns to make sure there aren't nulls all over the place, but I am trying to avoid if possible.
See table for example data set. I have transformed 2 files, one "Actual", one "Budget", and they are appended. How do I unpivot the "Source.Name" column in a way where I have two columns, "Actual" and "Budget", their corresponding value for GL Code, GL Name, and Cost Center? I will provide example below the data.
Data:
Source.Name | GL Code | GL Name | Cost Center | Value |
Actual | 6010-0000 | Salaries | 4009195 | 5 |
Actual | 6010-0000 | Salaries | 4009196 | 10 |
Budget | 6010-0000 | Salaries | 4009195 | 20 |
Budget | 6010-0000 | Salaries | 4009196 | 25 |
Desired Result:
GL Code | GL Name | Cost Center | Actual | Budget |
6010-0000 | Salaries | 4009195 | 5 | 20 |
6010-0000 | Salaries | 4009196 | 10 | 25 |
I appreciate any instruction you come up with!
Worst case it can be done in two queries, merged, adding custom columns to make sure there aren't nulls all over the place, but I am trying to avoid if possible.