We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Preserving Alteryx data type when output to excel

annlago
5 - Atom

Hi Everyone, 

 

I'm having trouble getting my Alteryx output to maintain the Alteryx data types when the output is opened in excel.  I've tried numerous - outputting to excel directly, outputting to an excel template that has been formatted to match the data types in Alteryx (I've done this both directly and through the Blob tools).  The closest I've come is by choosing CSV in the Alteryx ouput tool.  However, excel is still changing fields designated as V-String in Alteryx into numbers if the field contains all numbers and excel is also removing trailing spaces that I actually need to stay intact.  

 

Any help would be appreciated!

6 REPLIES 6
Bren_Spill2
12 - Quasar
12 - Quasar

I'm sure there's a better approach than this but, using a formula tool, try adding a single quote (') to the beginning of the field that you want to maintain the formatting for. That should force it to stay as vstring and keep the white space once it hits excel.

 

Formula = " ' "+[stringfield] 

 

If you can attach your workflow may be able to give a better answer. 

OTrieger
14 - Magnetar

@annlago 

This is relating to Excel and not to Alteryx. You might write out numbers and then Excel will convert them into dates etc.

If you will write the data out to csv format and then will open the output with Notepad you will have all the data in the correct format. So Alteryx doing everything as intended.

If you will need to use excel after that the data is been output, then you can cheat excel by adding an apostrophe (') to the data and then excel will regard all the data as text and will be as is.

cjaneczko
13 - Pulsar

As @OTrieger mentioned this isnt Alteryx, this is Excel. If you dont want to have the data types altered you can edit the settings in Excel to prevent the data from being converted to numbers or the trailing spaces from being removed. Take a look at your settings in excel as shown below.

 

 

image.png

annlago
5 - Atom

Thank you for all of your quick responses!  I had previously tried adjusting the data settings in excel but it wasn't accomplishing what I was looking to do, great suggestion though.  I added an apostrophe to all of the text fields using the Multi-Field formula tool and reran the workflow.  When I opened excel the apostrophe was visible which I wasn't expecting (I'm used to only seeing the apostrophe in the formula bar when it's used to have excel treat the entry as text).  It also still removed the trailing spaces.  The workflow I'm building is part of a process where the output from the workflow is ingested into another application that requires an excel spreadsheet and is very inflexible about data types and is also validating against data that contains trailing spaces, it's proven to be a bit challenging for certain things. 

Thanks again, I really appreciate the help and suggestions. 

cristiane_dsc
7 - Meteor

Can you share a mock sample of the data you're using and your workflow? I've tried to replicate the situation, but in my case Excel kept the original data format,  not even after removing the spaces in between the numbers. The data was still text after saving to Excel. Leading and trailing spaces were removed, though. Here is what I've used as a test:

 

NameAgePhone Number
Clara2344 5 7894 2345   
Nancy4231 5 6789 0999  
Peter4512 4 7345 6678 
John56   55 6 9278 9887
Florence32  55 8 0292 8876
Christpher33 76 9 0987 6566
Bruno2198 9 7356 8887   
Jack6055 6 9284 6665  
Barbara3344 5 7364 2234 
Karen40   98 6 8367 7836

 

The third column is the one with V_String data and trailing and leading spaces.

cjaneczko
13 - Pulsar

The other thing you can try is a Formula or Multi-Field formula tool to replace the standard space with the non-breaking space. I don't know how this will impact how excel sees the space in your instance. 

 

Replace([Field 1], " ", CharFromInt(160))

 

Labels
Top Solution Authors