I've been trying to join two layers (one shapefile point-layer and one table without geometry) using one attribute column with mutual attributes. Normally this works perfectly.

However, only one fifth of the attributes are recognized and linked. This is really weird because I specifically checked that both the values are the same. I think the failed join might have something to do with the spaces in the field values (see screenshot).

Does anyone know a code to use in the field calculator to automatically remove all spaces in the attribute values? I want all values in the column 'DEFINITIEF' to be each one continuous string without spaces. I think the join/recognition of the same values will work better then. The type of column in the two layers is the same (Text, 100 characters).

screenshot column that I want to use to join the two layers

1 Answer 1


Use the replace QGIS function. So replace from the field "DEFINITIEF" the space characters (' ') with nothing (''): replace("DEFINITIEF", ' ','')

  • Works great! Thanks a lot!
    – BramV
    Aug 17, 2023 at 7:18

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.