Is it possible to make a new column and store only the numbers in the column "GNR" i.e. removing (1: ))?

enter image description here


With a proper regexp term using the regexp_substr() function:

 to_int( regexp_substr( "GNR", ':([^)]+)\)' ) )

that retrieves all characters between : & ) like so:

  • :: match sequence must start with this character
  • (: start retrieving sub-string
  • [^)]+: collect all characters that are not )
  • ): end retrieving sub-string
  • \): match sequence must end with this character (escaped because ) is a meta character)

Use one of these expressions:

replace (replace (GNR, '(1:',''),')','')

left (substr( GNR,4),length('GNR')-1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.