community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

String Field Type is Converting to Custom Field Type When Exporting CSV File to Excel

Meteor

Good morning,

 

I'm hoping someone can help me out here.  I have a column in Alteryx formatted as String which has values such as 10050-00, 11866-00, 138-00, 10-00, 3-00, etc.

 

Basically, when I output the CSV file into Excel, it will change 10-00 to Oct-00 and 5-00 to Mar-00 in a Custom Excel format instead of a General format like the others.  Is there a workaround in Alteryx in order to prevent this from happening when the data is output?  Here is my formula I'm currently using in Alteryx for this field:

 

 iif( ([Bar #]) = "UNASSIGNED", "",  ToString([Bar #]) + "-00")

 

Thanks!

Alteryx Alumni (Retired)

I believe that is unfortunately the nature of Excel when opening a CSV.

 

As you can see from the below, you are not alone...

http://superuser.com/questions/841464/excel-formats-a-string-to-date-in-a-csv-file-how-can-i-retain-...

http://superuser.com/questions/234997/how-can-i-stop-excel-from-eating-my-delicious-csv-files-and-ex...

 

Try outputting to an XLSX format instead. That should maintain the String data type (although it still shows the message..."This cell contains a date string represented with only 2 digits for the year.") :smileyindifferent:

 

Or if you really do need a CSV, I like a suggestion from the second link above...cheat and add a space before the values you are creating. Excel will then recognize as a string and keep the original format.

Labels