I am using QGIS 3.22.1. I have a single FEMA NRI shapefile layer in my project that contains many 'features' (aka columns in the attribute table). For instance, there are columns for risk of drought, hurricanes, and other natural disasters. I know how to pick off a specific feature and create a style to display it nicely on the map. But, I want to be able to apply different styles to several more of these features and then easily toggle between or even turn them on simultaneously.

In the left side layers panel, I'd like to see something that emulates this:

|_|FEMA Shapefile Layer
    |_| Drought Risk
        -> Categorized Style Classification
    |_| Hurricane Risk
        -> Categorized Style Classification
|_|Other Shapefile Layer(s)

Then I want to be able to be able to select and show Drought Risk, Hurricane Risk, or both on top of each other, hopefully with simple checkbox toggles.

Is the best way to do this to simply duplicate the layer and apply a different style to each of the copies?

  • 2
    I think you mix terminology a bit: in the attribute table, columns (from top to down) are fields/attributes, whereas rows (from left to right) are called features.
    – Babel
    Dec 25, 2021 at 10:58

3 Answers 3


Sometimes the simplest answer is the best one, and you already identified it.

Is the best way to do this to simply duplicate the layer and apply a different style to each of the copies?

Import the layer into the map as many times as needed using the same source and theme each layer. A layer should generally only have one function and therefore one theme. Using the same source, will ensure that all the layers will have the most up-to-date information and each thematic layer can be easily toggled.

You can use QGIS' Content Groups organize and allow you to toggle the visibility of all layers.

enter image description here

  • The canonical solution is using layer styles, this has the benefit of not cluttering up the layers list and might be more intuitive semantically (depending on your understand of what a layer is, data or representation). Dec 25, 2021 at 9:49
  • 2
    @bugmenot123 I think that might be a bit more dependent on the asker's use case. I interpreted it as an interactive display or presentation to an audience, If it is just to make static maps then Styles would be great. In a presentation-like use-case, switching styles without updating the Layer's metadata leads to ambiguity as to what you viewing, in my opinion, without stopping and changing labels, names, etc.
    – RomaH
    Dec 25, 2021 at 17:57
  • 1
    With the three answers given now I think we covered every possible use-case. :D Merry Christmas! Dec 26, 2021 at 9:01

The so called "Styles" the best solution for this. Right-click your layer and "Add..." a new Style (you can also rename the currently selected style there, e. g. from "Default" to "Drought Risk"). enter image description here

Then you can set up this new Style's symbology in any way you like and easily switch between them.

enter image description here enter image description here

By using this approach you have a well setup project, these Styles can also be used in Layouts or Map Themes in a straight-forward way.


To define different styles based on conditions from attribute values, use styling with Rule based renderer (see docu). You can achieve (almost?) everything you could do with other methods.

You can add as many styles as you want and define for each simple or complex conditions when it should be visible. It will be still one layer only, but with many different styles.

Basic settings

In the layer panel as well as in the Layer styling, you can activate and deactivate each style by clicking the checkbox next to it: see the red arrows in the screenshot.

One layer, styled with four different styles, here based on a filter condition (Rule) based on the polygon's Name attribute - you could include other attribute fields to create complex conditions: enter image description here

Use with scalar attributes: data driven override (manual)

If you have scalar attributes and want to get a graduated style based on the attribute value, you can use data driven override for any part of the style like color, fill style, stroke width, stroke style etc. Set a rule based renderer and then in the style settings, click on the data driven override icon at the right side of the setting options and click on Assistant:

enter image description here

Then select a source (be it an attribute field or a more complex expression), load min/max values (or enter them manually) and select a color ramp to get a graduated style.

Graduated style: solid fill with a white-to-blue color ramp, based on the attribute value (see label for the value for each feature); Storke color and stroke width (border of each polygon) similarily styled based on the same attribute: enter image description here

Refine selected rules to create categorized or graduated styles (automatic)

You have even more options selecting one rule defined style by selecting one of the three options under Refine selected rules (right click rule or open it at the bottom of the panel, see screenshot). Here, you can, between elso, choose Add categories to rule or Add Ranges to rule to create a style that corresponds to Categorized or Graduated layer style rendering.

Graduated style based on the attribute value, but only for features with value > 50. I used Add ranges to rules with the expression scale_linear( value,50,100,0,100) to "spread" the color ramp (use the full spectrum of the white-to-red color scale) for values from 50 to 100: enter image description here

  • Rule-based was one of the first methods I explored and I can see how it works well in your example. However, I was unable to see how it can be applied to attributes that are scalar. If instead of 'name', my attribute for Rule 1 was 'rainfall_level' and I need to display in a graduated style with a color ramp, I didn't see a way to do this. In other words, I couldn't figure out how to apply a second level of symbology to the individual rules. If I missed something, please let me know!
    – co_9753
    Dec 26, 2021 at 0:48
  • Added that to my answer, see updated post
    – Babel
    Dec 26, 2021 at 11:18

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.