We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Here's an Alteryx Macro that adds commas to numbers

juvillalobos
7 - Meteor

I believe this should be a standard tool on Alteryx, probably under the Reporting tools group. 

 

Here's how to use it if you have not used Macros: 

 

  • Save it in a folder
  • Go to Alteryx and right click on your workflow
  • Select "Macros" and brows for the Macro file you saved
  • It will be added as a tool
  • Connect it to an input
  • On the left side of the screen, select the column you want to add commas to 
  • Run the workflow 

This workflow uses a Python script to add the commas. There might be easier ways, but Python is very effective at this type of tasks. 

3 REPLIES 3
SPetrie
13 - Pulsar

Thank you for sharing!

I appreciate creative solutions to common problems.

 

To also add to this, the ToString fuction will add commas for you when converting from a number to a string.

ToString(x, numDec, [thousandsSeparator], [decimalSeparator])

ToString([number],2,',') would give you a number with two decimal places and commas for the separators.

juvillalobos
7 - Meteor

There's definitely different ways to make this happen, this was the quickest approach I found, though. 

Dev73
8 - Asteroid

Thanks for sharing @juvillalobos .

Labels
Top Solution Authors