In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Converting to string

poonawala001
5 - Atom

Hello,

 

I have a column in my file with multiple rows of numbers like 30000, 565000 and so on.

 

I want to convert these to string format like 30,000 and 565,000 and so on.

 

Could you let me know how to do this?

 

Thank you!

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus

Hi @poonawala001 ,

 

 once you convert to a string, you won't be able to do math with these fields. 

you can use a formula to create a new field or use a multi-field formula and change the type. 

ToString([your field],0,1)

 

TOSTRING(x, numDec, addCommas)Converts a numeric parameter to a string using [numDec] decimal places. There is also a third parameter to return the appropriate comma.

Optional Parameters:

addCommas: 0 or false (default) means format the numeric string without commas; 1 or true means format with commas.


cheers,

 

mark

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
poonawala001
5 - Atom

Thanks Mark for the prompt response. So the column where I have the 30000 number is a "Text" column, is there a way I can make it numeric, very similar to the comma-style thousand separator format in Excel?

MarqueeCrew
20 - Arcturus
20 - Arcturus

ToNumber([your field])

 

but before you do that, if there are commas present:

 

replace_char([your field],",",'')


you can then change type in a select to int64 if you didn't define a new numeric field. 

 

 cheers,

 

mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
poonawala001
5 - Atom

Thanks Mark. Apologies for the dummy question here, but if you refer to the attached, my output still shows as 90000. I want 90,000

MarqueeCrew
20 - Arcturus
20 - Arcturus

@poonawala001 ,

 

Alteryx doesn't apply masks to data in a browser. 

numbers appear without thousands separators. So text field can have them, but are not capable of math. Only convert to text for output would be my recommendation. I seldom convert to text unless I'm done with all calculations and need to make the data pretty. 

thanks for the question,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels
Top Solution Authors