Parsing $ value from field including both strings and integers

Hey there,

I’m trying to parse out the $ value from a field containing both integers and strings.

Example

The input I currently have is in the Field named ‘Description’ and the output I’m looking for is for Field name, ‘$$’
image

I’m aiming to do this via custom dimension or the SQL runner

For the custom dimension, have broken the problem down and created dimensions for the following:

  • Contains $ (YES/NO)
  • Position of the $ sign
  • Substring using the position of the $ --> the problem here is that have to identify a length and all of the values are different lengths.

Any help would be appreciated!

0 2 350
2 REPLIES 2

Dawid
Participant V

Could you assume that the end of your $ value is at the first space after the value or end of line?

If you found the first position of space after your $ sign then you could use that, or if it’s false then end of line.

you could combine space with period probably. But all this is assuming you haven’t got values like 500 000 where space is part of the value

Does your database support some sort of regex function? While I’m no expert at regex, I know it can do quite powerful things. If you are on Redshift, then I would suggest REGEXP_INSTR might get you there.

Top Labels in this Space
Top Solution Authors