Alteryx Designer Desktop Discussions

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

Can I put commas in a number without converting it to a string?

wonka1234
10 - Fireball

Hi,

 

Say I have the number 1000000 as a int64, how can I make it 1,000,000 but keep it in number format?

 

Thanks

3 REPLIES 3
rzdodson
12 - Quasar

@wonka1234 if you don't want to do change the number format or add Formula tools, you can toggle this option.

 

Solution.png

AndrewDMerrill
13 - Pulsar

To my knowledge you cannot have commas in a numeric field. That being said you can add them in at the end of your workflow after doing all your calculations (changing the type to string) to format your output and make it look however you'd like.

 

EDIT:@rzdodson I did not know that could be done, very nice!

The only "down side" is that this button will apply to all numeric fields, so if you have a field that is numeric like Year that you don't want formatted like this, you'd need to do something else.

rzdodson
12 - Quasar

@AndrewDMerrill: you are absolutely right: it will apply to all numeric fields so be cautious before beginning to adjust/toggle anything.

 

@wonka1234 as for formatting, @AndrewDMerrill is spot on. You would need to change this value to a string-based field before adding any type of commas. Depending on how the initial data is retrieved (e.g. through SQL code in an Input or In-DB tool) you would be able to change the value to have commas in it with a CAST or CASE statement, where applicable. But, in that case, you would functionally still turn it in to a string value first. With that said, if you are outputting it to a specific template file - let's say an .xlsx file - you can change the formatting there and have it so it adds the commas you are looking for. Several options, so dealer's choice.

 

 

Labels