[QGIS-Developer] Please help! - QGIS expressions don't evaluate as expected

Evan Kanter evankanter28 at gmail.com
Sun Aug 12 12:45:52 PDT 2018


Hi Devs,
I’m sending you a link to my post on Stack Overlow, requesting assistance!
https://stackoverflow.com/questions/51812251/qgis-expressions-dont-evaluate-as-expected

I would really appreciate your help. I am pasting the content of my post on stack overflow below for your convenience.

Evan Kanter
evankanter28 at gmail.com

I am using QGIS with a vector layer and the attribute table stored at this link:https://docs.google.com/spreadsheets/d/1K7rRdlcSheclJ6MqzpBNwSZei911WDV1Bl2zBGV38-s/edit?usp=sharing
I then have the following code:
CASE

/*Kieran Winner*/
WHEN "r_Kieran" > "r_Wynne" 
        THEN ramp_color('PCMarg', scale_linear(("r_Kieran"/"r_TOTAL"-"r_Possian"/"r_TOTAL"),  0,  1, 0, 1))     
ELSE color_rgb(64, 224, 208)
END
Here's the problem: The code evaluates incorrectly.
Take row 15 of the attribute table for example. (Where PD_Number=14) You would expect that the condition would evaluate TRUE since "r_Kieran"=397 and "r_Wynne"=225.
But, it evaluates FALSE in QGIS, as indicated by the colour that is displayed on the map!
I've spent hours simplifying code, and pulling my hair out over this.
Please help!
Thanks, Evan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180812/165f1d1e/attachment.html>


More information about the QGIS-Developer mailing list