This is probably a basic and simple question which has been answered multiple times before, but my Google-fu has come up empty, so here we are.
Long story short, to simplify my analysis, I want to copy the data from the first zoning column field to the second into ONLY in cell values which are blank. I will attach a screenshot to show what I am talking about.
I have tried various [case when] and [if] examples, but nothing seems to get this thing to go.
2 Answers 2
Starting with a layer, in which some values in a field are blank, enter the following in Field Calculator and select Update Existing Field, zone_2:
if("zone_2" is null, "zone_1", "zone_2")
Alternatively, if the fields are simply blank rather than NULL, enter the following:
if( "zone_2" = '', "zone_1", "zone_2")
The result is the same, as shown below.
Before:
table prior to update, with nulls
After:
If your conditionnal test doesn't work you can also select the "right" features and update only those selected (there should be a checkbox to limit the changes) ...
-
UPDATE: Thanks. Yeah, I pretty much did this. I did a select by expression, then at the top of the attribute table I selected [overlay] and put in "zonedist" and clicked update selected. If someone wants to show how to do this with the field calculator though, I am all for learning new things :)Benjamin Smith– Benjamin Smith2018年02月27日 17:18:42 +00:00Commented Feb 27, 2018 at 17:18