Hi Andreas, On Thu, Dec 22, 2011 at 2:31 PM, Andreas Neumann <[email protected]> wrote: > What I want is that a label is only drawn if a column value is larger than > 0. I don't want to label features with a value of zero. > > Do you have any hints how the syntax works for such a case? I see ">" > operators but no "if" or "when".
there's no "if" operator, but ">" returns 1 if true and 0 if false, e.g. (field > 5)*10 let's give you 10 or 0 as result. The problem is that you don't want to display anything when the field value is 0, so we can use the substr function. Here's the solution to your problem: substr(id, 0, (id > 0)*-1) that means if id <= 0 then substr(id, 0, 0) else substr(id, 0, -1) In general: substr(output, 0, (condition)*-1) Cheers. > If it is not possible, then I can still do it in Postgis, but it would be > nice being able to do this in QGIS. > > Thanks for any hints, > Andreas > > -- > -- > Andreas Neumann > Böschacherstrasse 10A > 8624 Grüt (Gossau ZH) > Switzerland > _______________________________________________ > Qgis-user mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-user -- Giuseppe Sucameli _______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user
