Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

This cell has embedded newlines

eblee
6 - Meteoroid

Hello,

 

It looks like my database includes some cells that have embedded newlines. I am trying to pull line items that contain "business development", and the filter function is having trouble identifying those with "business" in one line, and "development" in the next (within the same cell). I need to search for these two words together with the space in between, because otherwise i get results like "business requirements development".

 

Is there a way to remove these breaks within a cell in Alteryx? For example, something similar to the "Clean" function in Excel. I tried using the "Trim" function but that only seems to get rid of whitespace.

 

Thank you!

 

8 REPLIES 8
RodL
Alteryx Alumni (Retired)

Try using the RegEx tool. You can use the Replace Method with the '\n' to search for any new line characters and replace it with ' ' (or a blank string).

jdunkerley79
ACE Emeritus
ACE Emeritus

You could also use a filter tool with a Regex Match formula to select there cells:

 

REGEX_Match([Field1], 'Business\s+Development')

The \s+ will match all whitespace (tabs, new lines, spaces) between business and development

 

Alternatively a formula tool like could be used to normalise all white space could be used:

REGEX_Replace([Field1], '\s+', ' ')
chris_love
12 - Quasar
Believe it or not you can also enter a carriage return into a formula and
alteryx will understand it. eg. Have a filter formula that says:

[field] = 'Business
Development'
eblee
6 - Meteoroid

Thank you! The RegEx worked by replacing it with a blank string. Everyone's comments were really helpful!

HemantWalia
5 - Atom

Hi,

 

I know this is old post I am replying to, not sure if you are still around in community.

 

I am using a crew macro to write the log to an output file, in my case, the warning is thrown but I cannot see newline in the text file. The complete log look like a big string. Do you know if there is a way to preserve newline so that while writing to file it does not ignore that.

nasomani
5 - Atom

I see you got a fix with the Regex. You could also have fixed it with your data cleansing tool by selecting the option to remove linebreaks

AJuliet101
7 - Meteor

@RodL thanks. It worked for me too.

Giantstride
5 - Atom

Thanks for sharing, the formula tool option worked for me.

Labels