Skip to content
Advertisement

Pivoting across multiple Fields with multiple Count/Sum

I have the below results within a table.

The SQL

How can I turn this into the following with it in date order, and the MonthYear being flexible where it could contain any number of months/years?

I’ve got the following so far, but can’t manage to finish it off:

Advertisement

Answer

You would need both Unpiovt and Pivot to achieve the desired result. I’ve added to your code.

please see the demo here.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement