4

I know the syntax in order to fill one field with only one condition (field calculator):

case 
    when "attribut" = 'value' then value 
end 

But how to do populate automatically one field with two or three or more conditions?

I tried the following command but it does not work:

case 
    when "attribut" = 'value' and "attribut number2" = 'value' then value     
end

Could you throw light for me?

1

1 Answer 1

5

Your values need to have single quotes around them, one has a double quote and one has no quotes (field names need double quotes i.e. "field" and field values need single quotes i.e. 'value'):

This should work:

CASE
    WHEN "attribut" = 'value' AND "attribut number2" = 'value' THEN 'value'
END

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.