[GIS] Multiple overriding rules for styling in QGIS 3.4.0

attribute-tablecolorqgisrule-based

I am a total beginner to QGIS and still struggling with the basics. After a quick research on this forum I could not find the answer to my current issue.

What I am trying to do is to colour the regions of a country shapefile where using the information stored in a series of categorical variables. So for each variable if that category is "yes" I want the region to be coloured in one colour (also I would later like to have a legend for the colours, but I'll worry about that later..). I have started doing this using rules-based styling in the attribute table, but I am unsure how to do it when there is conflicting rules, when a region has multiple entries of "yes". If I use single rules, then colours are overwritten by the rule hierarchy. Ideally I would like to have this region colours in stripes.

Does anybody have an idea how to do this?

Here is a description of my data structure.

enter image description here

Best Answer

If you have in the attribute table YES and other strings as shown in the image below, you can do the following:

enter image description here

  • Go to Rule-based Style
  • Add this Rule in the Filter: "FieldName" = 'YES' #You need to change FieldName based on what you have in the attribute table. In this Example: "YES_NO" = 'YES'

enter image description here

  • Add a new rule and in the Filter section select ELSE

enter image description here

  • The Rule based Style should look like this:

enter image description here

Here is the output:

enter image description here

Related Question