Discussion:
[mapguide-users] Mapguide 2.5.2 fdo expression IF with a string field
Rémy Gourrat
2017-05-17 10:37:51 UTC
Permalink
Hi,

If i use the FDO expression with a number field like this => IF('FIELD1 = 1','Yes!','No') it's Ok

But I don't know how to escape the quote character when I want to use it with a string field, I tried it without success :

IF('FIELD1 = \'A\'','Yes!','No')

IF('FIELD1 = ''1''','Yes!','No') double single quote

IF('FIELD1 = "1"','Yes!','No') one double quote

Thanks for your help

Rémy





-----
AG-Carto - Bayonne
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Mapguide-2-5-2-fdo-expression-IF-with-a-string-field-tp5320800.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
Jackie Ng
2017-05-18 14:21:43 UTC
Permalink
You could try using LOOKUP() as a workaround. This should be equivalent to
what you're trying to achieve.

LOOKUP(FIELD1, 'No', 'A', 'Yes')
LOOKUP(FIELD1, '1', 'A', 'Yes')

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Mapguide-2-5-2-fdo-expression-IF-with-a-string-field-tp5320800p5320956.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
Rémy Gourrat
2017-05-18 14:49:31 UTC
Permalink
Thanks

It's the right way.

Rémy

Loading...