A QGIS expression (0<=0”az”<180) related to a column az with values 0 to 360 returns all records. Tried to_int and to_real as well because source of the data was a csv and result was same.
-
1"az" >= 0 and "az" < 180 is more SQL ish, I don't think that ranges are supported like you stated, or at least I haven't seen a working example like that. Refer gis.stackexchange.com/questions/109328/… also have a read of gis.stackexchange.com/questions/89269/… to ensure that QGIS is seeing your numbers as numbers and not text.– Michael StimsonDec 4, 2017 at 3:09
2 Answers
Something along the lines
if(0<=to_int(az)<180,do one thing,do another thing)
should work for the field calculator. Make sure to check which field type "az" is (layer properties -> fields), maybe you can leave the "to_int" out. Refering to the column has to be without quotation marks in this context - don't ask me why.
Thanks Michael and Erik as the references and comments were helpful in reaching the following solution: "az" >= 0 and "az" < 180 By the way the attribute table was numeric as every value had a huge number of decimal places. Clicking on the field headers sorted the table. QGIS claims a certain level of SQL capability for expressions and this problem is entry level stuff that still intimidates rookies like me. Paul