1

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.

enter image description here

2 Answers 2

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:

enter image description here

0

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) ...

1
  • 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 :) Feb 27, 2018 at 17: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.