Alteryx Designer Desktop Discussions

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

Convert to number

JustynaMZ
7 - Meteor

Hi,

I am just a beginner and have faced a problem with 'tonumber'.

Can you please advise me how to convert string to the number.

I tried to use ‘tonumber’ nevertheless I probably do smth wrong as still receive data which are not treated as a nr.

Description

I have report with two dates.

I counted days from between ‘Date B’ and ‘Date A’, Result was saved in column ‘Result”

Now I need to use formula which will select only rows where ‘Result’ <=10 (I used ‘IF”).

As a records in column ‘Result’ are in incorrect format I receive false information.

Date A

Date B

Result

14.03.2020

24.03.2020

10

13.09.2020

13.10.2020

30

14.02.2020

14.02.2020

0

08.07.2020

06.07.2020

-2

 

Thanks for help!

J.

4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

Hi @JustynaMZ 

 

You should be able to use tonumber() function (see attached). But the best way is changing the data type with the Select Tool (also attached)

PhilipMannering_0-1607290457140.png

 

Hope this helps

Phil

DaisukeTsuchiya
13 - Pulsar

Hi @JustynaMZ .

I recommend to convert DateA and Date B into date type format then calculate Result with Number type in formula.

1.JPG

2.JPG

Qiu
20 - Arcturus
20 - Arcturus

@JustynaMZ 
Make me wondering why your 'Result' field becomes non-numeric at first place.

If you are using DateTimeDiff, we need to change the Data Type to something 'Numeric' then it will all work out.

I am keeping your original fields for comparision.

1207-JustynaMZ.PNG1207-JustynaMZ-1.PNG

Tyro_abc
11 - Bolide

Hi, @ 

You can do it in two steps or one step

 

A: Two Steps

1) Find the difference between dates using a Formula tool

2) Filter on the difference using a Filter tool

arundhuti726_0-1607296469619.png

arundhuti726_2-1607296614383.png

 

B: Using one Step

Calculate difference between dates and use that to filter 

 

 

arundhuti726_1-1607296544394.png

arundhuti726_3-1607296647844.png

 

I think you are already in the right direction but have some issue with data types.

 

 

Regards

Arundhuti

 

 
 

 

 
 

 

 

Labels