Free Trial

Alteryx Designer Desktop Discussions

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

type conversion

Ecaterina
7 - Meteor

Hi

 

I am grabbing the data from a google sheet, 

The numbers from the google sheet are like (-400.-500). When I imported this data in Alteryx the column with the number value has the data type string.

I need it to be a number  to be able to make some aggregations,

How to convert the "-4000" string to a number? 

The value could be positive or negativ

Thanks,

5 REPLIES 5
Emil_Kos
17 - Castor
17 - Castor

Hi @Ecaterina,

 

Use a select tool. Expand the drop-down and pick the type double:

 

Emil_Kos_0-1621248470173.png

 

dougperez
12 - Quasar

Hi Evaterina! 

Just use a Select Tools to convert It to double

MarqueeCrew
20 - Arcturus
20 - Arcturus

@Ecaterina ,

 

i know not of these Google sheets.   
Are you looking for types or cheats?

 

numbers as strings

are terrible things

 

 if you use a select

 your numbers may get wrecked!

 

An expression toNumber()

is less likely to err

 

 Alteryx chooses a string

 when it finds a non decimal thing

 

If regex_countmatches([field],"[^\d\.\-]") doesn't equal zero,

You may look like a schmo when your results become zero. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
atcodedog05
22 - Nova
22 - Nova

@MarqueeCrew 

 

Great words of wisdom 🙂

 


@MarqueeCrew wrote:

 

If regex_countmatches([field],"[^\d\.\-]") doesn't equal zero,

You may look like a schmo when your results become zero. 



What should we do if regex_countmatches([field],"[^\d\.\-]") doesn't equal zero and we want the actual numbers and not zero. I guess clean the text.

DanielG
12 - Quasar

I agree with @MarqueeCrew -- something that seems like it would have a simple fix like the select tool has burned me in the past.  You need to really know the possibilities coming from that column before just using the select tool.  It can make your data go away without necessarily having the workflow throw an error.  Which is obviously less than ideal.  🙂

 

Labels
Top Solution Authors