2

I want to display the cluster size with a condition : I don't want to display this information for small clusters. The expression is working fine but I don't know I can add else...

case 
when @cluster_size > 30 then @cluster_size
end

Is my case, cluster size of the clusters with a size > 30 are displayed. BUT cluster <30 are labelled with a A letter AND I want to display NOTHING.

Not working :

case 
when @cluster_size > 30 
then @cluster_size
else @cluster_size = NULL
end

Returns me 0 but not empty :

case 
when @cluster_size > 30 
then @cluster_size
else @cluster_size = ' '
end

If I remove A letter from the assistant, nothing is displayed.

enter image description here

6
  • What do you want to display in Else condition?
    – ahmadhanb
    Commented May 3, 2020 at 7:35
  • @ahmadhanb I want to display nothing
    – Wilcar
    Commented May 3, 2020 at 7:40
  • 1
    Have you tried Else NULL?
    – ahmadhanb
    Commented May 3, 2020 at 7:41
  • @ahmadhanb not working : case when @cluster_size > 30 then @cluster_size else @cluster_size = NULL end
    – Wilcar
    Commented May 3, 2020 at 7:45
  • 1
    I think it should be just '' to display empty text instead of NULL
    – ahmadhanb
    Commented May 3, 2020 at 7:51

1 Answer 1

4

I am not sure what is wrong in your case but I can confirm that Else '' removed the A and got empty cluster:

case 
when @cluster_size > 30 then @cluster_size
else ''
end

enter image description here

Output

enter image description here

I am using QGIS 3.10.4.

1
  • 1
    I used wrong syntax
    – Wilcar
    Commented May 3, 2020 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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