3

I'm trying to use an expression to label a layer by using the "name" field but only if it has certain entries from the "type" field. The expression I've tried is:

NAME IF  "TYPE" IN  ('RIV-MAJ', 'LAKE-PER')

Can someone suggest how I would go about this?

6

If you want to assign the values which is stored in the "NAME" field when the value stored in the "TYPE" field is 'RIV-MAJ' or 'LAKE-PER', you may use this expression:

CASE
WHEN "TYPE"='RIV-MAJ' OR "TYPE"='LAKE-PER'
THEN "NAME"
END

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.