[Qgis-user] New Labeling: conditional labels

Martin Dobias wonder.sk at gmail.com
Fri Jan 6 16:31:38 PST 2012


On Fri, Jan 6, 2012 at 1:25 PM, Martin Dobias <wonder.sk at gmail.com> wrote:
> SQL recognizes CASE statement with following alternate syntax:
>
> 1. "if" equivalent:
> CASE
>  WHEN x > 10 THEN 'big' ELSE 'small'
> END

Just pushed a commit implementing that.

The syntax is:
CASE WHEN cond1 THEN exp1 [WHEN cond2 THEN exp2]* [ELSE exp3] END

There may be one or more WHEN/THEN clauses. If no condition matches,
the expression from "ELSE" is evaluated - if none is specified then
NULL is returned.

Note: the other syntax with "base" expression (CASE x WHEN y THEN z
... END) is not supported yet.

Have fun!
Martin



More information about the Qgis-user mailing list