On Wed, Mar 16, 2011 at 10:20 AM, Borys Jurgiel <[email protected]> wrote: > Dnia środa 16 marca 2011 o 10:08:47 Martin Dobias napisał(a): >> On Tue, Mar 15, 2011 at 12:52 PM, Borys Jurgiel <[email protected]> > wrote: >> > Do conditional expressions work in the Field Calculator? They're listed >> > in the Help, but I can't make them working (as I do in Raster >> > Calculator). >> >> Hi Borys >> >> can you give me an example of what are you trying to do? > > Just use the functionality listed in help - comparision operators: > > (field_1 > field_2) * field_3 + (field_1 <= field_2) * field_4
It seems that our grammar is slightly flawed: the comparison operators in qgis can be used only on "top level" e.g. "field_1 > 0 or field_2 = 0". So they work if you are doing a search in the attribute table, but they don't if you're trying to use them in an expression. I see you have already opened a bug for that. The parser and evaluation code definitely need some love (and unit tests!!) in order to keep up with increasing demands from the users :-) Martin _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
