How to pivot up the data? | Community
Skip to main content
Level 2
May 17, 2022
Solved

How to pivot up the data?

  • May 17, 2022
  • 1 reply
  • 1582 views

I have below scenario:-

 

CUST_ID  JOB_CD

123            ABC

123            XYX

 

OUTPUT:-

123       ABC, XYZ

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kapilKochar

Hi,

 

You can use Query activity and Enrichment in a workflow to change your data set and get result in above format. Try below steps

 

A) As an example I have created a schema name as cus:pivot

 

B) Create a workflow like below 

i) Query activity

ii) Take the enrichment activity and make the self join with same table with the help of 1: N join while giving join condition

 

While adding the data please make sure to add column(No. of records to retrieve as per your convenience (By default it will be max 3 rows) ). So it will create multiple enrichment table based on your records to retrieve. In below example since I have two values so I have selected two

 

Add your data from these different temp enrichment table and result will be like below

 

Hope this helps. 

 

 

1 reply

kapilKochar
kapilKocharAccepted solution
Level 6
May 17, 2022

Hi,

 

You can use Query activity and Enrichment in a workflow to change your data set and get result in above format. Try below steps

 

A) As an example I have created a schema name as cus:pivot

 

B) Create a workflow like below 

i) Query activity

ii) Take the enrichment activity and make the self join with same table with the help of 1: N join while giving join condition

 

While adding the data please make sure to add column(No. of records to retrieve as per your convenience (By default it will be max 3 rows) ). So it will create multiple enrichment table based on your records to retrieve. In below example since I have two values so I have selected two

 

Add your data from these different temp enrichment table and result will be like below

 

Hope this helps. 

 

 

Data_guyAuthor
Level 2
May 18, 2022

Thanks Kapil.

 

I am not able to find "Select additional columns" from your snippet. Where to set these columns to create field?

 

 

kapilKochar
Level 6
May 19, 2022

Here you go