Alteryx Designer Desktop Discussions

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

VString to Double with Commas

kubikbr
6 - Meteoroid

Looking for some help on the issue below. Data source export is in the first column, which contains numbers with commas and is coming into Alteryx as VString. Normally, I just use the select tool and change to double or a number. In this instance, Alteryx is taking the first two numbers before the comma and dropping the rest. 

 

Do i have to just find replace the comma to fix? or is there an alternative solution? thanks

 

SourceAlteryx Workflow
vstringdouble
Pmt AmtPmt Amt
25,500.0025
108.33108.33
26,350.0026
26,350.0026
24,650.0024
108.33108.33
8080
7 REPLIES 7
AGilbert
11 - Bolide

try the tonumber() function. 

 

tonumber.png

kubikbr
6 - Meteoroid

this approach is unable to convert any negative numbers in the dataset, looks like those are just bring treated as 0.

 

workbook attached with full dataset 

binuacs
20 - Arcturus

@kubikbr you need to remove the ',' from the amount field to convert it into double

image.png

kubikbr
6 - Meteoroid

binuacs - this approach is still converting negative numbers in the large dataset to 0, which is overstating the column total. 

AGilbert
11 - Bolide

Looks like your negative numbers are formatted with parenthesis. Use the replace and tonumber functions below. Example attached. 

 

Screenshot 2024-05-15 063557.png

binuacs
20 - Arcturus

@kubikbr As @AGilbert mentioned if you have brackets for negative numbers you need to replace them

 

toNumber(ReplaceChar([Pmt Amt], ',()', ''))

 

image.png

kubikbr
6 - Meteoroid

thank you both for your help on this

Labels