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

underdark
84.9k22 gold badges237 silver badges418 bronze badges
asked Feb 27, 2018 at 17:08

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

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

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
answered Feb 27, 2018 at 17:15
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 :) Commented Feb 27, 2018 at 17:18

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.