When dealing with symbology in QGIS, there are over eight(8) options one can use. The symbology utilized is dependent on the data available; category, quantity, ratio, interval, and many more. Depending on the data available you have the option to use single symbols, categorized or even graduated symbols. Rule-based symbology offers flexibility and more control over the creation of your symbols.
As shown below, different symbologies will produce desired results in various modes and visualizations.
To implement complex rules in rule-based symbology, a good understanding of selecting features using an expression is required. Depending on the rules, the expressions can be simple or complex. In the expression string builder in QGIS, there are many functions and options that one can use to achieve the required expressions.
In an ideal situation, depending on the attributes in a layer, one can always construct an expression to filter the features on the layer. As mentioned above, an expression can be simple or complex. These expressions depend on the desired outputs. For example; One can write an expression that uses one attribute/field in the attribute table or you can have multiple attributes used. QGIS offers a long list of functions to use in your expressions.
In the example above, shown in the screenshots, the use of the logical operator “OR” denotes that this expression uses one attribute for selection. In the tutorial below, you will have a chance to use other logical operators and also customize your expressions to suit the data in your project.
In most cases, Rule-Based symbology is useful when you require full control of your symbology options. Remember, there’s no limit on the number of rules that can go into a layer.
To do this practically, I’ve recorded the video below.
Let me know if you have questions on this topic.