Designer - remove duplicates and convert column to row

I have a column with ticket/invoice numbers that I need to convert into a row of text separated by commas. I have figured out how to remove blanks, but that’s as far as I have got (image below).

Welcome to forum.

I think it would be easier to use a script in the workflow to process the data in advance and then create a separate file and use it on the design side in that case .