Oct 21, 2024 07:28 AM
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?
Thanks & best
Mirko
Oct 21, 2024 09:19 AM - edited Oct 21, 2024 09:44 AM
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.
Oct 21, 2024 11:26 PM
Hi, thx for the answer.
I found a solution. Here the formular:
Best
Mirko