I have a field of currency values in an attribute table. As an example, I'm attempting to replace £10,000.00 to 10000.00 so QGIS can run graduated styles on the new field. The following replaces the £ sign with a blank character.

replace(  "field_name", '£', '')

I'm struggling to get rid of the comma in the same expression. I have tried:

replace(  "field_name", '£', '') || replace(  "field_name", ',', '')

but this returns 10,000.00£10000.00

The 'replace' expression doesn't seem to cater for more than one character to target as a replacement. Do I need to do this over 2 expressions?

2 Answers 2


You need to use a nested replace() function such as


You can nest as many replace() as you want.


You can do both replacements using a single function call:

1) using regex_replace, where you would look for the two characters of interest (inside square brackets):


or 2) the map variant of replace, where the map is a series of key-value, the key being the string being searched for and the value being the replacement string


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.