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.
fireworks

V String currency - adding comma

RWilson
5 - Atom

Hello all

 

I am very new to Alteryx and I am gradually trying to migrate all our manual reports over. 

 

My situation is;

In the source data file I have a "Total Overdue" column. This column is set as a V_String. I need it to be a currency column (as in it has a £ in front of the numbers, and has commas and set to 2 decimal places).

 

So if it says this -  555676.8023

I need it to say this - £555,676.80

 

At present I have managed to set the V_string length to 15 decimal places to show the correct number of numbers and I have also used a formula to add in the "£" sign at the beginning ("£"+toString([Total Overdue],1,2) 

 

So it now looks like this - £555676.80

 

but I cant for the life of me sort out the comma??

 

Any help would be greatly appreciated - thankyou in advance

8 REPLIES 8
JosephSerpis
17 - Castor
17 - Castor

Hi @RWilson have a look at this article on the Alteryx community "Everything You Need to Know About Currency"

nagakavyasri
12 - Quasar

If you add Comma to the number it becomes String and mathematical operations like sum, diff would not be possible.

RWilson
5 - Atom

Hey JosephSerpis

I've seen this article before but didn't have much luck. I've tried again and copied his steps but it results in the following error message ; 

"The formula resulted in a string but the field is numeric"

Rana_Kareem
9 - Comet

Hi @RWilson ..

 

Is this what you want ?

 

ToString.png

RWilson
5 - Atom

Thank you but that hasn't worked either 

KamenRider
11 - Bolide

I suggest to work first the computations for numeric data type and convert it to string type to allow the comma and dollar sign as the final output.

 

DataNath
17 - Castor
17 - Castor

@RWilson based on the fact that you're getting "The formula resulted in a string but the field is numeric" as an error message, when you're making your new field, you'll need to ensure that this is a string data type - in the drop down menu under the expression editor. The error suggests that you have the data type set to numeric and you're trying to create a string within it.

Rana_Kareem
9 - Comet

@RWilson   Could you try this method:

 

Change the Data Type of the column "Total Overdue" to Double.
and add a new Formula with a new column with V_String data type, containing this expression:

 

"£" + toString([Total Overdue],2,1)

 

You can then deselect the unwanted column using Select Tool.

 

Hope that helps

Labels
Top Solution Authors