Comma separated
- 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
Help, I tried a few solutions from the discussions but didn't work. I am trying to comma separate numbers in my columns . The data type selected in my workflow columns is Int64. I do not need any decimal point. Can someone help me with a simple solution.
Solved! Go to Solution.
- Labels:
- Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Sophie95,
Do you want to place both numbers in one column separated by a comma or replace the decimal points with commas?
Both can be done in a formula tool shown in the attached workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Sophie95
If you want Alteryx to treat the fields as numbers, then they need to be without comma separators. Currently, they are all set to string data types, which is why they have decimals.
To change to an integer, use a Select tool.
To create output with the commas, you'll need to leave the fields as string, and you can try the approach suggested in this thread: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Formatting-number-with-commas-and-deci...
Let me know if that helps.
Cheers!
Esther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here's an example of how it works.
The Dynamic rename tool just pops the first row of data into the column headings. The Select tool then changes Column-1 and 2 into Integers to lop off the decimal points.
A MultiField formula tool lets you apply the same transformation to both of those columns. Where this tool tripped me up is in the Field Size of the new fields. I hadn't originally made them long enough to accommodate all of the commas. So be sure to check off change output type to, and make the string longer.
The formula I used is (from the post in my original response):
regex_replace(tostring([_CurrentField_]),"\d{1,3}(?=(\d{3})+(?!\d))","$&,")
It involves backward lookups, etc. Let me know if that helps!
Cheers,
Esther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@ ESTHERB47:-
Thank you so much it worked!! You can see my workflow below. I have my end results numbers with commas and ready for reporting. This is my first workflow attempt right to final expected results..
Now I want to create the reporting section with the dashboard etc. I can just continue using the reporting tools where I left off with the final results correct? Which reporting tools do you recommend and a good reporting video I can watch?
Very appreciated!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Sophie95
Here's a good video. https://community.alteryx.com/t5/Videos/Introduction-to-Reporting/td-p/47216
Which tools you use depends on how you want to present your data. The Table tool helps you get the data into a beautifully formatted table. Charting tools let you build graphs. The Layout tools (or Visual Layout in the Laboratory tools) can help you put everything together.
You might want to describe how you'd like the report to look in another post here on the community. There are definitely reporting experts who will jump in to help.
Cheers!
Esther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks again!!!
