Unpivot Data Using Python


Problem Statement

In one of the Business Analytics Dashboards Projects, Sales data is received from different countries (100 +) around the globe. This data is consolidated and depicts trend analysis KPIs, such as MTD, YTD, and ITD. The data received is in an Excel file in a crosstab style (Pivot) format, which is not standard. In addition, each country may have Sales volume of different months. For example, the USA may have 12 months of Sales, Canada may have 8 months of Sales, and UK may have 5 months of Sales.

To process this data and load it into the data