Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

merge multiple comments for a record into one line

jimmys
6 - Meteoroid

I have mutliple comments per record ID like this:

orig.PNG

and I would like to merge them into a single value with line breaks like this:

 new.PNG 

 

How would I do this?

Thank you.

 

 

 

12 REPLIES 12
MarqueeCrew
20 - Arcturus
20 - Arcturus

Jimmy,

 

You would use a summarize tool and then a formula.  The summarize is a concatenation function and the formula is a regular expression.  I've included a working module for you to examine.

Capture.PNG

 

Thanks,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
RodL
Alteryx Alumni (Retired)

Interesting use case. Smiley Happy

 

I was able to do this with the Summarize tool...

Group by the ID, and Concatenate the Comment using "\n" (New Line) as the Separator.

 

It shows up in a Browse after that as being in two lines, but not sure about then when you output it. I've tried outputting to Excel (which is what it looks like you are wanting) and Excel doesn't seem to recognize the embedded new line.

 

Maybe someone else can add to this?

RodL
Alteryx Alumni (Retired)

Mark,

Most don't realize you can insert many different separators in the Summarize Concatenate parameters, so that would eliminate your Formula tool. Smiley Wink

However, I'm still not getting it to output to Excel where it recognizes the new line. 

Any ideas on how we might get that to work?

Rod

MarqueeCrew
20 - Arcturus
20 - Arcturus

@RodL

 

Thanks for the tip on the \n separator!

 

When I output my module to a .xlsx worksheet I agree that the contents appear to be FLAT.  But after I double clicked a cell to look at it, It becomes multiple rows.  At this point it becomes an Excel question.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
RodL
Alteryx Alumni (Retired)

Ah...didn't notice that effect in Excel when you double-click. 

So Alteryx IS sending the new line character to Excel, and agree...it now becomes an Excel question.

Thanks.

jimmys
6 - Meteoroid

Mark/Rod,

Thanks for your replies. I need to be careful of the separator as these comments contain all sorts of characters, some even contain line breaks. So I'll need to test these. Thank you! -Jimmy

jimmys
6 - Meteoroid

also this will not be going into Excel, it will be imported into Salesforce.

jimmys
6 - Meteoroid

to wrap up, I am going to use <br> as my separator as this will be going into an html field within Salesforce. Thank you both for your help!

MarqueeCrew
20 - Arcturus
20 - Arcturus
You're quite welcome.

Sent from my iPhone
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels
Top Solution Authors