Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

How can i transpose this table?

Avatar

Level 2

 

ID  FirstName LastName Email

1   Name1       Name12    Email1

2   Name2       Name22    Email2

3   Name3       Name32    Email3

 

i want to convert above table into

 

ID   AttributeName   AttributeValue

1     FirstName        Name1

1     LastName        Name12

1     Email                Email1

2     FirstName        Name2

2     LastName        Name22

2     Email                Email2

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

Repeat insert statements for each of your cols:

  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'FirstName', FirstName from old_table
  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'LastName', LastName from old_table
  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'Email', Email from old_table 

 

You can also do this with select->update->update->update in a workflow.

 

Thanks,

-Jon

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi,

 

Repeat insert statements for each of your cols:

  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'FirstName', FirstName from old_table
  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'LastName', LastName from old_table
  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'Email', Email from old_table 

 

You can also do this with select->update->update->update in a workflow.

 

Thanks,

-Jon

Appreciate it. I am trying to do this with workflow. Anyway to do this with workflow enrichment?

Avatar

Community Advisor

No enrichment, just use ordinary query and update activities. For the query the filter is @ID > 0.