The last field in each row of my workflow has the following formula:
if [RowCount] = 1 then '101'
else
'103'
endif
In the output I am getting "101" or "103" but I do not want quotes.
I am exporting as a .csv with a pipe delimiter | to a file with .txt extension and the code page is the default, ISO 8859-1 Latin-1.
Because I have the pipe delimiter, I cannot choose to Never Quote Output Fields. It only quotes this field; the other 46 fields are fine. I have read through all the other posts with similar problems, but the solutions do not work for me. I am wondering if it is because there is something in my IF formula here that is causing the issue. I have also tried the StripQuotes function to no avail. Hoping to learn something new here. Thanks!
Solved! Go to Solution.
Have you tried removing the quotes from your formula? I would also check the data type you are creating with that column
if [RowCount] = 1 then 101
else
103
endif
I need to update this; I found the reason for the quotes. I actually had a | in my IF statement:
if [RowCount] = 1 then 'ABC101|'
else
'ABC103||'
endif
Removing the pipe got rid of the quotes, but I still need to end each row with a pipe. Do I just need to add a null field to the end so that I get the pipe after the field with the IF function?
What is the purpose of the pipe you are feeding in? If you are trying to specify the delimiter you can define that in the output tool.
I would guess that adding the null field at the end in conjunction with this should achieve that end.
I was putting the pipe as the delimiter in the Output Tool, but I needed a pipe at the end of each row as the system we are uploading these to demands it.
I came up with a solution. First, I added a field and left all the rows empty. But I could not have the field name in the header row, so I tried to leave it blank, but Alteryx wouldn't allow that. I then renamed the field as ALT+255 which is the ASCII character for a hidden space. Alteryx allowed that name and I now have a pipe at the end of each row.
I still think there should be a way to end a line with a pipe, as the solution I am using above still requires the user to delete that hidden character
I am also looking for this same solution. I have tried various options and settings. Since the delimiter is not essentially closing the last filed, I am having to manually add it after the file is created.