whew, this won’t be pretty…
I think the way to think about this is to ‘split’ the input into two parts; and then ‘extract’ the dollar/number you want out of it.
so with your column named ‘input’, create a field named ‘dollarAmount’ with this formula:
REGEX_EXTRACT(LEFT(input,SEARCH(' • ', input)), 'C\\$ ]+?(\\d+(p,\\.\\d]+)?)' )
and then create a field named ‘endpointAmount’ with this formula:
VALUE(LEFT(RIGHT(input,LEN(input) - LEN(LEFT(input,SEARCH(' • ', input)))),SEARCH(' endpoints' ,RIGHT(input,LEN(input) - LEN(LEFT(input,SEARCH(' • ', input)))))))
so will this surely not work every time, because your unstructured data is sure to outsmart me given enough time. But this will get you a decent part of the way.
whew, this won’t be pretty…
I think the way to think about this is to ‘split’ the input into two parts; and then ‘extract’ the dollar/number you want out of it.
so with your column named ‘input’, create a field named ‘dollarAmount’ with this formula:
REGEX_EXTRACT(LEFT(input,SEARCH(' • ', input)), 'C\\$ ]+?(\\d+(p,\\.\\d]+)?)' )
and then create a field named ‘endpointAmount’ with this formula:
VALUE(LEFT(RIGHT(input,LEN(input) - LEN(LEFT(input,SEARCH(' • ', input)))),SEARCH(' endpoints' ,RIGHT(input,LEN(input) - LEN(LEFT(input,SEARCH(' • ', input)))))))
so will this surely not work every time, because your unstructured data is sure to outsmart me given enough time. But this will get you a decent part of the way.
I agree - that’s the right approach given the constraints of working in a formula. Two observations -
Sometimes it makes sense to avoid this drama by crafting a system that generates discrete values further upstream in the process. Is this possible? Often-times, we create very complex and brittle solutions that are fundamentally unneeded if we did something else better. Elon Musk - “The best part is no part at all.”
Numbers in a string are also known as entities, and there are some clever AI javascript approaches that allow us to extract entitles quite easily. Are you amenable to performing such data reclassification using script automation?