Help

Formular to Extract Numbers out of a string

Topic Labels: Formulas
78 2
cancel
Showing results for 
Search instead for 
Did you mean: 
mirkolando
6 - Interface Innovator
6 - Interface Innovator

Hi Community, 

i have a single select field with the following options. 

I want to add up the results from different columns in a formula. To do this, I need to extract the score from the rest. For example, only “2” should be extracted from “2 More then 20%” in the formula.

What is the best way to do this?

 

mirkolando_0-1729520875209.png

 

 

Thanks & best

Mirko 

2 Replies 2
Alexey_Gusev
13 - Mars
13 - Mars

Hi,
Try simple

 

VALUE({Field Name})

 

for options, starting with number, must be OK.
Note: if text contains dash, anywhere, value will be negative (like "5 Between 5 - 20%")   
if you have only positive numbers, additionally wrap into ABS

 

ABS(VALUE({Field Name}))

 

If you need something more complex, use 

REGEX_EXTRACT({Field}, '^\d+ ' )

means "take one or several digits from the beginning, followed by space". or

REGEX_EXTRACT({Field},'^\S+ ')

"take one or several any characters except space from the beginning, followed by space", if you have negative or floating point numbers.
Return value is string so you should wrap it into VALUE( ) to get a number.

 

mirkolando
6 - Interface Innovator
6 - Interface Innovator

Hi, thx for the answer. 

I found a solution. Here the formular: 

mirkolando_0-1729578353031.png

 

Best

Mirko