0

I'm attempting to copy just the numeric portion of a street address into a new table using the Field Calculator in QGIS. The expression I'm trying to use is:

left( "SITE_ADDR", strpos( "SITE_ADDR", " " ) -1)

strpos is giving an invalid expression error- column " " not found.

Is there another way to format this expression to actually work?

2
  • 1
    What does your site_addr value look like?
    – Nathan W
    Commented Nov 25, 2014 at 22:57
  • Can you give examples of the 'from' data? Commented Nov 25, 2014 at 22:59

1 Answer 1

0

I believe your expression should be:

left( "SITE_ADDR", strpos( "SITE_ADDR", ' ' ))

Note single quotes around string, do not need to minus 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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