convert excel column headers as row headers in azure data factory

Sudha Achuthan 20 Reputation points
2024-06-13T04:34:41.5066667+00:00

need to convert below example

input from excel source -

id qn1 qn2 qn3 ................ max q50

1 qr1 qr2 qr3 ................max qr50

2 qr1 qr2 qr3 ................max qr50

desired output -

id qn qr

1 qn1 qr1

1 qn2 qr2

1 qn3 qr3

.

.

1 qn50 qr50

2 qn1 qr1

2 qn2 qr2

2 qn3 qr3

.

.

2 qn50 qr50

.

.

3

.

.

10

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,619 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,928 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 18,106 Reputation points
    2024-06-13T10:23:46.1466667+00:00

    In your ADF pipeline, add a Data Flow activity.

    Set up your source dataset pointing to your Excel file.

    Then unpivot Columns:

    • Use an Unpivot transformation to convert columns into rows. In the Unpivot transformation, you will select all the question columns (qn1, qn2, ..., qn50) to be unpivoted.
    • Set the Key column to hold the column headers (qn1, qn2, ..., qn50) and the Value column to hold the responses (qr1, qr2, ..., qr50).

    If you need to rename the unpivoted columns for clarity, you can add a Derived Column transformation to rename the Key and Value columns to qn and qr respectively.

    Configure your sink to write the transformed data to your desired destination (for example another Excel file, a database...).

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more