Converting to string
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
Solved! Go to Solution.
- Labels:
- Tips and Tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
