I have created an output that looks like this and I also have a table (table A) that looks like the below
OUTPUT
Description | MONTH1 | MONTH2 |
---|---|---|
xyz | 2 | 5 |
abc | 4 | 6 |
TABLE A
column no | Month Name |
---|---|
1 | April 2023 |
2 | May 2023 |
the output was created using calculations like these:
COUNT (CASE WHEN a.column_no = 1 THEN a.ID END) AS MONTH1
COUNT (CASE WHEN a.column_no = 2 THEN a.ID END) AS MONTH2
Please is there anyways I can change ‘MONTH1’ to use the month name in table A instead without manually naming the column.
for example, in the output I would like month1 to say April 2023.
Can anyone help please.
I tried using a dynamic pivot but with no success
New contributor