Forum Discussion

pbrainard's avatar
pbrainard
Icon for Helper III rankHelper III
4 years ago
Solved

Concatenate three columns then split into rows

I need to concatenate these three columns, separated by delimiter. Sometimes there will only be one ID, sometimes two, and sometimes three. If there is no ID, it's a null value.

Here is what I'm doing to attempt this:

= Table.AddColumn(#"Renamed Columns", "Text.Combine", each Text.Combine({[Employee ID],[Employee ID2],[Employee ID3]},"; "))

 

but as you can see, I'm getting errors in the newly created column. Here's the error:

 

 

Once the combined column is created, I'll need to create duplicate row for each line with a ID2 and ID3.

 

Please help. This seemed like it should be straight-foward but, apparently not.

Thanks!!!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi pbrainard 

     

    The IDs are Number, not Text, try

    = Table.AddColumn(#"Renamed Columns", "Text.Combine", each Text.Combine((List.Transform({[Employee ID],[Employee ID2],[Employee ID3]}, Text.From), "; "))

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi pbrainard 

     

    The IDs are Number, not Text, try

    = Table.AddColumn(#"Renamed Columns", "Text.Combine", each Text.Combine((List.Transform({[Employee ID],[Employee ID2],[Employee ID3]}, Text.From), "; "))
  • Needed another ) after Text.From, but works like a charm. Thank you!!!