Convert to number
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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)
Hope this helps
Phil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @JustynaMZ .
I recommend to convert DateA and Date B into date type format then calculate Result with Number type in formula.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, @ JustynaMZ
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
B: Using one Step
Calculate difference between dates and use that to filter
I think you are already in the right direction but have some issue with data types.
Regards
Arundhuti
