8

I'm working with the last version of QGIS (3.8.3-Zanzibar), and I'm trying to represent a Rule-Based Symbology from a CSV file with the following rules:

Figure 1

And the data from the prcptot column is this:

Figure 2

As you can see, all the prcptot values are negative (smaller than 0), but the output that QGIS is giving to me is the next:

Figure 3

All the red triangles should be inverted blue triangles... I think that QGIS is taking all the values as positive numbers, but I don't know why or what to do.

8

The rules seem not to be correct. The first rule of your example is:

"prcptot" = "prcptot" > 0 AND "p.prcptot" <=0.09

while I guess it should read:

"prcptot" > 0 AND "p.prcptot" <=0.09

Stating "prcptot" = "prcptot"is a tautology, i.e. it gets always evaluated as true. The fact that it is chained with a > 0 before the AND operator might confuse the parser, and that could be the reason why not all triangles are red.

So the full rule set would be:

"prcptot" > 0 AND "p.prcptot" <=0.09
"prcptot" > 0 AND "p.prcptot" > 0.09
"prcptot" < 0 AND "p.prcptot" <= 0.09
"prcptot" < 0 AND "p.prcptot" > 0.09
"prcptot" = 0 OR "p.prcptot" IS NULL
  • 1
    I think the last one should be IS NULL – MrXsquared Oct 1 at 17:40
  • 1
    Thank you both! It worked perfectly! – DobriDobrev Oct 1 at 17:42
  • @MrXsquared thanks: edited – RafDouglas Oct 1 at 17:43
  • 3
    @DobriDobrev feel free to accept this answer if it solved your question – MrXsquared Oct 1 at 17:46

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.