Alteryx Designer Desktop Discussions

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

Using ToNumber to convert string to number is returning NULLs

sonseeahray
8 - Asteroid

I'm baffled...I'm using ToNumber to convert 2 string fields to numbers from a .txt file, but the results are returning 100% NULL. I've used this formula on .txt input files just this week, so I don't understand what is happening.

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus

Guessing that your data looks like:

 

1,000.00

 

 can you please show some sample data,

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
sonseeahray
8 - Asteroid

Hi @MarqueeCrew Mark!

 

Yes, of course and sorry.

 

The fields are coming in with leading spaces, so I clean that up before I apply the formula.

sonseeahray_0-1588720754250.png

 

Here is the segment of the workflow that I'm at...

sonseeahray_2-1588720856570.png

 

And...the results now are ZEROs rather than NULLs...at this point I don't remember what I did to get the NULLS

 

sonseeahray_1-1588720834984.png

 

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

Ok!

 

ReplaceChar([_CurrentField_],"$,",'')

 

 User this in a multi-field formula. 
change type to Double

rename or don't rename field ( I uncheck)

 

 this should help. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
sonseeahray
8 - Asteroid

Hi @MarqueeCrew Mark!

I'll give it a go! Thank you 😃

sonseeahray
8 - Asteroid

@MarqueeCrew! It worked beautifully. Was it that I didn't take into account the comas?

Labels