Alteryx Designer Desktop Discussions

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

Correctly split columns with delimiter

HW1
9 - Comet

I am trying to split a column with delimiter '-' but there are some field names with '-' in it as a part of the name which should not be split.

 

The delimiter is preceded and succeeded by  ' - ' (spaces before and after the delimiter) which is how it should be split. but if I put in that condition in the text to columns tool, the field names with spaces are getting split as well.

 

gamesgames1games2games3
Shimizu S-Pulse - Cerezo OsakaShimizu SPulse  Cerezo Osaka
Kawasaki Frontale - Shimizu S-PulseKawasaki Frontale  Shimizu SPulse
Shimizu S-Pulse - Urawa RedsShimizu SPulse  Urawa Reds
Kashima Antlers - Shimizu S-PulseKashima Antlers  Shimizu SPulse

 

 

While the correct way would be:

gamesgames1games2
Shimizu S-Pulse - Cerezo OsakaShimizu S-Pulse Cerezo Osaka
Kawasaki Frontale - Shimizu S-PulseKawasaki Frontale Shimizu S-Pulse
Shimizu S-Pulse - Urawa RedsShimizu S-Pulse Urawa Reds
Kashima Antlers - Shimizu S-PulseKashima Antlers Shimizu S-Pulse

 

How should I resolve this issue?

 

Please find attached my effort so far for reference:

 

 

 

2 REPLIES 2
Qiu
20 - Arcturus
20 - Arcturus

@HW1 
I assume the "-" between Games is having space before and after.

20210326-HW1.PNG

PhilipMannering
16 - Nebula
16 - Nebula

Hi @HW1 ,

 

The best thing to do would be to replace the space dash space with a new delimiter not in your data with,

replace(games, ' - ', '|')

 

See workflow attached.

Labels