Pivot Data from rows to columns with many possible values for pivot field

Convert this

accountId region reporttype count
1 APAC L1 Feedback Report 2
1 APAC L2 Feedback Report 2
2 APAC L1 Feedback Report 6
2 APAC L2 Feedback Report 4
3 APAC L1 Feedback Report 17
3 APAC L2 Feedback Report 4
3 EU L3 Feedback Report 3

to below one

accountId Region L1 Feedback Report L2 Feedback Report L3 Feedback Report
1 APAC 2 2 0
2 APAC 6 4 0
3 APAC 17 4 0
3 EU 0 0 3

Note : the report type can have many values so don’t need static way of mapping fields
unique key here is accountid and region

Hi @vaidyarm,

You can try to achieve that the way I did in the below pipeline. Please note that this might not be the most optimal way achieving what’s needed.

–sl-comm-pivot-rows-to-columns_2023_04_11.slp (14.5 KB)

BR,
Aleksandar.

1 Like

That worked perfectly

Thanks a Lot @AleksandarAngelevski :grinning:

1 Like