Wednesday, 23 October 2019

Using replace function to replace value to one of value map using QGIS field calculator?


I kind of made a mistake, with a certain setting one column to a value map. Originnaly the "Regio Column' had text which consited of four specific value's (five if I count Null with it). To make thing simplier for field work, I decided to add a dropdown list, and for specific "numbering reason" of the object I gave each text a number, but in actuality they see only the text they need to choose. But something went wrong and it is kind of my own fault since I needed to replaced text. I cannot change this now.


Now because I have over 3000 records changing manualy those (centrum) and other values to the actual value of the value map choice by choosing down the dropdown list is kind of tedious. I tried to use the replace function but I cannot get it right. To illustrate see image below:


enter image description here


What I am doing wrong here?



Answer



You missed a comma after your field, it should be


replace("Regio", '(centrum)', '1')

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...