I have a table with a lot of place names. There are much too many names for all of them to be shown on the print composer map. Some names are important, and in the column fontsize these have a bigger font size number (for instance 270). I want to prioritize bigger font size names over smaller font size names. So I go to Layer Properties -> Labels -> Placement -> and in Priority chose a data defined override by selecting the field fontsize .

Should this work? It does not give rational results, as some smaller labels are still shown instead of bigger ones.

Qgis version 2.18.7

  • 1
    How about using Label z-index along with associated data defined override to assign the font size as control?
    – Kazuhito
    May 31, 2017 at 14:34
  • Can you provide examples?
    – underdark
    May 31, 2017 at 18:23

1 Answer 1


If you want to disable completely from showing small labels, you can use Properties -> Labels -> Render -> Show labels and write the following formula:

"fontsize" <> 270 THEN NULL
Else "Name"

Where "Name" is the field name that contains the names you want to show.

enter image description here

Do not forget to use Label with "Name" or the suitable field name that shows the names.

In the following example, I am showing only the Ids that their font size bigger than 50 stored in a field name "Num"

enter image description here

  • 1
    Thank yoy @ahmadhanb , I do need to show also small labels if there is space enough for them, but I need big labels to always be prioritized over smaller ones. May 31, 2017 at 8:31
  • 1
    @BenjaminDonner How do you define the "enough space"? I think the spaces among the labels are different.
    – ahmadhanb
    May 31, 2017 at 8:59
  • 1
    @ahmadhandb, preferably: - no labels should go on top of eachother. If they would do this, omit showing smaller size labels (id "fontsize" has a smaller number than the other label) - no labels should go on top of point symbols in the layer "symbology". Jul 20, 2019 at 6:46

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