How do you have the custom format automatically add quotes when there's a comma in a field
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Labels:
- Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If you have Quote Output Fields set to Auto it should do whate you want
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is there a formula that i can use for the address field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you attach a sample of data and what you want to get out?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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])
