Hi,

Yes - this is possible with the SQL CASE syntax - like:

CASE WHEN val < 0 THEN 'negative'
  WHEN val = 0 THEN "neutral'
  ELSE 'positive'
END

You can of course use different fields in the statement.

Hope this helps,
Andreas

Am 10.10.2012 09:06, schrieb Davide Inchingolo:
> Dear List,
> I'm new in QGis, and I like this software very much.
> Now, my question: is it possible, in Field Calculator and in Labels, to use 
> conditional expressions in the form: IF <condition> THEN <result> ?
> I would like to use expressions in which <condition> is based on other fields 
> in the Attribute Table, and write the <result> for the field I am 
> calculating, or for the labels.
> I hope it is so, but, not knowing SQL well, I don't know the correct sintax, 
> nor if it is possible...
> 
> Hoping in some gentle replies,
> Best regards
> Davide Inchingolo
> 
> 
> 
> _______________________________________________
> Qgis-user mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/qgis-user
> 

_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to