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

How do you have the custom format automatically add quotes when there's a comma in a field

Dom
8 - Asteroid

I noticed in my output file that one of the fields has a comma so I would expect it to automatically output double quotes for that field when the format is comma delimited. The output file I removed all quotes. So, i only need it for fields that have Comma's for instance the address field.

11 REPLIES 11
jdunkerley79
ACE Emeritus
ACE Emeritus

If you have Quote Output Fields set to Auto it should do whate you want

 

 autoQuote.jpg

Dom
8 - Asteroid

Auto doesn't work when since my delimiter is set to \0.  I have to have it set this way because with , setting it makes eveything in one string with Auto setup. see layout screenshot

jdunkerley79
ACE Emeritus
ACE Emeritus

Setting the delimeter to \0 stops Alteryx putting any delimeter into the file (i.e. all columns would become a single value)..

 

Auto will hence not add any quotes as it doesnt find any delimeters in the string.

 

The easiest way to get quotes around strings with this setting would be to use a multifield formula to add the quotes.

 

Have attached a demo

Dom
8 - Asteroid

Is there a formula that i can use for the address field?

jdunkerley79
ACE Emeritus
ACE Emeritus

Can you attach a sample of data and what you want to get out?

Dom
8 - Asteroid

That's not going to work based on my configurations. I don't want to change my configurations because everything works except if there's a comma in a field of this comma delimited file. 

 

I'm trying to use a filter. I want it to search for a , then use double quotes in that field if it finds a comma. I started it below but i need more assistance. 

 

 

FindString([Address1],",") > -1 

jdunkerley79
ACE Emeritus
ACE Emeritus

Try:

 

IIF(Contains([Address1],','),'"'+[Address1]+'"',[Address1])

Attached a quick demo 

Dom
8 - Asteroid

Ok, so I added this in a filter and it removed some rows of data. Then i added it to a formula, it seems to work but now the it add " " to all data in the address field insted if field contains a comma. Also, I received an error 

IIF(Contains([Address1],','),'"'+[Address1]+'"',[Address1])

with contains in the expression. I had to change it to findstring because contains is not an option in 9.5. 

Dom
8 - Asteroid

Since i have 9.5 version, contains is not an option to use for this version to use this expression.

 

IIF(Contains([Address1],','),'"'+[Address1]+'"',[Address1])
Labels