Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Change V_WString data to double after adding comma

kauser
8 - Asteroid

Hello, 

once i add comma to output through Alteryx (following formula) -

 

if [_CurrentField_]<0 then Replace("("+ToString([_CurrentField_],2,1)+")","-","") else ToString([_CurrentField_],2,1) endif

 

Issue- 

all data change into string. so in my output file number come as "Number stored as text" with a green triangle sign on upper left corner.

 

expectation-

now i need to change all these data from  "Number stored as text"  to double. 

7 REPLIES 7
alexnajm
17 - Castor
17 - Castor

Can you show us an example of your data and your desired output so we can better understand?

kauser
8 - Asteroid

Please see attachment and we want to remove that upper left corner green triangle and convert it to numeric so we can use these data for mathematical calculations. 

 

 

cjaneczko
13 - Pulsar

Once you add any commas or punctuation to the field it becomes a string. If you want to see the Comma in Excel, i would format the sheet in Excel and save it. Then in your Alteryx Output Tool check the Preserve Formatting box and set the range of your data. Once the data is overwritten on the destination file it will keep the commas. But doing so in Alteryx will turn it into a string field as it now has string characters in the field. 

alexnajm
17 - Castor
17 - Castor

This ^

kauser
8 - Asteroid

@cjaneczko  Hello, 

I tired but still same issue. i try to change to template file as you said but didn't work. not sure what went wrong. is there anything else i need to do. 

cjaneczko
13 - Pulsar

Did you set the range in the Output Tool? It wont preserve the formatting unless the range is set, even with the box checked. 

 

image.png

kauser
8 - Asteroid

@cjaneczko  Hello, 

Sounds like its working but some first few lines have no commas (first two lines product A & B). 

 

TypeQ1Q2
Product A458456859745
Product B215486548798
Product C506,458.25894,589.89
Product D950,205.85124,589.25
Labels
Top Solution Authors