Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
galafish
Contributor II
Contributor II

Convert string with number to number

Hi, please advise how to convert the text with number in it into just number in the load editor.
I have a field Duration with  string data that has a number of days, and I want to convert it to just a number:

Duration string       Duration num
12 Days                       12
1 Day                            1
2.5 Days                      2.5

Please notice, the string could be 'Days' or 'Day'.
I tried Num#, it didn't really help.

Thank you!

Labels (1)
3 Solutions

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

in your load script use below

Left(YOUR_COLUMN,Index(YOUR_COLUMN,' ')) as YOUR_COLUMN

basically get the index of the space and get the character to the left of it 

View solution in original post

Vegar
MVP
MVP

Subfield([Duration string ], ' ', 1) as [Duration num]

View solution in original post

SukumarBera
Contributor III
Contributor III

Please use keepchar() function .

Keepchar([Duration string],'0123456789.') as [Duration num]

View solution in original post

4 Replies
dplr-rn
Partner - Master III
Partner - Master III

in your load script use below

Left(YOUR_COLUMN,Index(YOUR_COLUMN,' ')) as YOUR_COLUMN

basically get the index of the space and get the character to the left of it 

Vegar
MVP
MVP

Subfield([Duration string ], ' ', 1) as [Duration num]

SukumarBera
Contributor III
Contributor III

Please use keepchar() function .

Keepchar([Duration string],'0123456789.') as [Duration num]

galafish
Contributor II
Contributor II
Author

Thank you all!

I tried all the suggestions and they all worked! I don't even know which one to choose as a solution 🙂 All methods worked for me.

Thank you again!