Alteryx Designer Desktop Discussions

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

Number Format

JStuhler
6 - Meteoroid

Hi! I am using ToString to convert numeric values to string in order to add commas and decimals. The problem is I later use a filter >= a numeric value, which no longer works because the field is a string. If I try to convert it back using ToNumber, I lose the commas. Does anyone have a solution for this? 

3 REPLIES 3
binuacs
21 - Polaris

@JStuhler if you add , to the numeric value in Alteryx it will become string data type, if you want to change back to number then use the formula toNumber(ReplaceChar([Field],",","")) - change the data type to double or any other numeric type

JStuhler
6 - Meteoroid

I tried the formula ToNumber(ReplaceChar([_CurrentField_],","," ")) and it does revert back to a number format, but loses the commas. Withing the formula I get a message with a red X that says "tried to apply string operator to numeric value"

OTrieger
13 - Pulsar

@JStuhler 

Before adding the commas, create a new field which will keep the original value, now you will have one numeric field and one string, use the numeric field for the Filter purpose and then remove it with a Select tool to remain only with the string field. Just keep it simple by using 2 different fields

Labels
Top Solution Authors