Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Comma separated

Sophie95
8 - Asteroid

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.

6 REPLIES 6
DanielMS
Alteryx
Alteryx

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.

 

 

 

 

estherb47
15 - Aurora
15 - Aurora

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

estherb47
15 - Aurora
15 - Aurora

@Sophie95 

 

Here's an example of how it works.

 

image.png

 

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

Sophie95
8 - Asteroid

@ 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!!

estherb47
15 - Aurora
15 - Aurora

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

Sophie95
8 - Asteroid

Thanks again!!!

Labels