Pivoting with multiple columns

I have a data set like

. I want to identify how many unique employees are there and how many complaints have been escalated out of how many they have worked on? Can anyone please help?

Hi @Omprakash_Jena

Looks like a job for the Unpivoting node. Value Columns the Employee 1 to 5. Retained Columns: Complaint and Escalated.

gr. Hans

3 Likes

Hi there @Omprakash_Jena,

after Unpivoting you can use GroupBy node two times. One to count number of complaints employee worked on and one to count number of complaint escalated per employee. For the second one you will first need to filter row where escalated? column is yes. After that use Column Appender node to have everything in one table.

Complaints

Edit: Or additionally you can use Pivoting node after Unpivoting with ColumnValues as group column, escalated as pivot column and any other column with Count aggregation.

Br,
Ivan

3 Likes

Thank you so much…!

1 Like

Thank you Hans!..It’s helpful.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.