[mapguide-users] Tooltip - Expression Editor - IF THEN

Gordon Luckett gordon.luckett at arrowgeomatics.com
Thu Jun 3 11:20:26 PDT 2021


I am not sure the IF statement is working as designed right now.
You could try it as 'CALCULATION' in the data source, and then you have it
without having to do it in the Tooltip.



On Thu, Jun 3, 2021 at 5:41 PM Diego Ordonez <diordonezr at hotmail.com> wrote:

> Thanks Gordon.
>
> This is Real Time data from Public Lamps (lights) in a city in Colombia,
> it works really well by the way.
>
> I'm writing the Tooltip like this:
>
> 'Estado: ' , estado, ' -- ',
> IF ('Trim(estado) = "Encendida"' , 'ON', 'OFF'), '</BR>',
>
> But still it always shows "*OFF*" regardless of the value of the column
> "estado"
> May be my syntax is wrong, something about the quotes ??
>
>
>
>
>
>
>
>
>
>
> ------------------------------
> *From:* mapguide-users <mapguide-users-bounces at lists.osgeo.org> on behalf
> of Gordon Luckett <gordon.luckett at arrowgeomatics.com>
> *Sent:* June 3, 2021 12:02
> *To:* MapGuide Users Mail List <mapguide-users at lists.osgeo.org>
> *Subject:* Re: [mapguide-users] Tooltip - Expression Editor - IF THEN
>
> Perhaps it's not matching?
> Try the TRIM() function?
>
> On Thu, Jun 3, 2021, 4:59 PM Diego Ordonez <diordonezr at hotmail.com> wrote:
>
> Hello All
>
> I have a question that in theory should be fairly easy, but I'm having
> trouble
>
> Trying to show a tooltip based on the value of an attribute (From
> Postgresql 12 - Mapguide 4.0 Ubuntu 16.04)
>
> The name of the column is estado, it has two values "Encendida" (ON) or
> "Apagada" (OFF)
>
>
> *'Estado: ' , estado, '</BR>', *
> *IF ("estado" = 'Encendida', 'ON', 'OFF'),*
>
>
> The first line works with no issue, showing the right "estado" (status).
>
> What is the syntax to write in the ToolTip Expression Editor ? The second
> line
>
> I've tried different ways but it always shows OFF even if the LAMP is on
> in the database.
>
> Thanks in advance for your help
>
> Diego
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20210603/673949b7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 60923 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20210603/673949b7/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 79378 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20210603/673949b7/attachment-0001.png>


More information about the mapguide-users mailing list