I need help to show '0' value with expression. When I show only label from a row, '0' appear, but I want to add the expression in the color :

WHEN  "max_44_mol_pharma"  < 100 THEN  color_rgb( 0,0,0)
WHEN  "max_44_mol_pharma"  >=  100 THEN  color_rgb( 255,0,0)

enter image description here enter image description here enter image description here enter image description here and the '0' disappear. Can you help me to resolve this issue?

  • Where the 0 value should be located? Is it under the column max_44_mol_pharma and you want to show it in a different color, or what? – ahmadhanb Mar 5 '18 at 9:00
  • Columns sorry ;-) I have differents columns and want for each show the value. If I use only labels to show the values, everything is ok i see the '0' for each columns. But i would like to use the expression above to color the values in black and red with the limit of 100. And with this expression, the '0' value is no longer visible ! – Fabrice Mar 5 '18 at 9:16
  • I hope it is possible ! – Fabrice Mar 5 '18 at 14:03
  • Perhaps it would help to use the color format rgba, which adds an opacity value. When the opacity is set to 0, the label will be invisible. – csk Mar 5 '18 at 17:56

Try with this option ON in the Labels tab of the Layer Properties.

It does not seems to be ralated with the condition.

enter image description here

Updated with your new screenshots:

enter image description here

The filter is a logical expression, so it filters out when the expression in the field is FLASE or (which is the same in this context) zero.

  • Hello, it doesn't work with this option ! – Fabrice Mar 5 '18 at 15:02
  • Maybe I did something wrong! Under Description, there is "filtre" and I juste select the field I wanted. Maybe I have to do other thing ? – Fabrice Mar 5 '18 at 15:07
  • paste the screenshots of the conditional labels, is the zero in a different field than the other values? – Marco Mar 5 '18 at 15:28
  • Hello Marco, I send the details of my data – Fabrice Mar 6 '18 at 8:19
  • Do you want to filter out some records? It does not look like, but you are the one who knows what do you want to present, but there is your mistake – Marco Mar 6 '18 at 8:39

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