I'm trying to create the following rule based expression for displaying a line: if column "riparian Veg" has a 'Yes' entered into it then display the line but if another column titled "Primary" has 'Riparian vegetation management' entered into it then do not display the line.

How do I create this expression in QGIS?


1 Answer 1


On the symbology tab of the properties -

Select Rule-based

For the filter enter "riparian Veg" = 'Yes' AND NOT "Primary" = 'Riparian vegetation management'

capitalization matters - it has to match the field names and attribute values. I just copied what's in your question. If that's not exactly what's in your layer, it won't work.

You use the query builder (the curly E button next to the filter text box) to create this filter with point-and-click. Expand the Fields and Values tree to get your fields. Double-click a field to enter it into the expression. When a field is highlighted, you can click on Values to get a list of the values in the attribute table. Double click a value to enter it into the expression.


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.