4

I am using QGIS 2.14 and I am trying to make some of my labels bold to stand out. I'm not sure how to do this using the expression builder. I know this is wrong and I was wondering if someone could let me know how to correct it:

CASE WHEN
"Style" like '%2016%' then  Bold
ELSE Normal
END

"Style" is my layer of points, I need the 2016 labels in bold.

My only solution I have at the moment is making a 'Bold' column in my attribute table and using this field to select features to be bold. I think this clutters up my attribute table and different maps require different labels bold.

Joseph
  • 75,746
  • 7
  • 171
  • 282
T.O.6
  • 947
  • 2
  • 10
  • 16

1 Answers1

6

In your Label settings interface, click the Data defined overide button for the bold option:

Label bold setting

Then use an expression like:

CASE WHEN "Style" LIKE '%2016%' THEN 1 ELSE 0 END

The input for this setting is boolean (i.e. 1 or 0).

Joseph
  • 75,746
  • 7
  • 171
  • 282