06-15-2017 06:25 AM
I was working in GeoMedia 2016 v16.1with attribute based Symbols and noticed that the NULL() function is not being recognized in an IF-Syntax.
I'm working with a Point feature and a Font Style type for the Symbols.
If the attribute "date" is empty, then no symbol should be displayed at all. If not, then the attribute value of "date" should be displayed.
The Syntax IF(date IS NULL; ''; date) works as expected.
When I use IF(date IS NULL; NULL(8); date) the default value or symbol is being displayed instead of no symbols at all. It seems like the NULL() function doesn't work for this purpose. Is this working as designed or is the NULL() function supposed to be working here as well?
The commands IF(date IS NULL; NULL; date) , IF(date IS NULL; NULL(date); date) , IF(date IS NULL; date=NULL; date) do not work neither.
I also encountered issues when setting the font color. I tried to use nested syntaxes
Thanks for any inputs
Solved! Go to Solution.
06-15-2017 04:05 PM
I'm not quiet sure I understand correctly what you want to do or what you expect with your expression.
The expression IF(date IS NULL; NULL(8); date) is the same as 'date'.
If you don't want to display the symbol in the case of date IS NULL, use for the attribute based symbol option "displayable" the expression "date IS NULL" (or in a long for beginners more readable version: IF(date IS NULL; TRUE(); FALSE()) ).
06-16-2017 11:27 AM
If you are trying to display the date if it is not NULL or some other attribute if the date is not NULL, then do the following.
For the FontSyle in the advanced tab set the Displayable property expression to: Input.MyDate=NULL(Date) where MyDate is the date field of your input feature. Then in the CharacterString property set the expression to: FORMATATTRIBUTE(Input.MyDate) where the MyDate is the field that you want to display.
06-19-2017 01:01 AM
Thanks a lot for your replies.
Maybe I didn't make myself clear enough, I'm sorry.
What I was trying to find out is the difference between the two expressions, as I was expecting IF(date IS NULL; NULL(8); date) to give the same result as IF(date IS NULL; ''; date).
In case of IF(date IS NULL; ''; date) no symbol at all is being displayed when date IS NULL, which is what I want.
In case of IF(date IS NULL; NULL(8); date) the Default Value is being displayed as Symbol when date IS NULL. If the condition date IS NULL is evaluated to true for a specific data point, then the function NULL(8) should return a "NULL-value". So why is the default value being displayed instead?
06-19-2017 01:47 AM
NULL is not really a value in a strict sense.
So you can't say what an application is doing with this "value" in general. In theory NULL as boolean is not TRUE and not FALSE, it's UNKNOWN. So the application and/or the database server defines how it handle this.
In the case of GeoMedia symbology NULL is mapped to the default value - obviously. You have to map NULL with an expression to a "real" value, like discussed.
06-19-2017 05:04 AM
In the responses you have the solution of your problem. It is not possible do achieve what you want to do with only one expression, but you can combine style properties to achieve it
In your case :
06-19-2017 05:06 AM
Cristina, you have perhaps run into a side-effect of a fix introduced with 16.0, which was first described in the Impacts section of the Release Guide for 16.1 (and also in 16.2). I'll paste that info in here. - Hal
Boolean Expressions with Attribute-Based Symbology
When an expression is evaluated in the context of the map display system (e.g. in an attribute-based definition for a style property), and that expression yields a Boolean data type with a NULL value, then that NULL value is now returned as expected. This is important because some Boolean style properties (e.g. Displayable) are defined as “if missing, then true”. If the expression were to return a value of FALSE rather than NULL, then a NULL value cannot be received by the style property.
However when such an expression is evaluated in any other context (e.g. in the computation of a functional attribute), then the NULL value is converted to FALSE in order to simulate previous behaviour and minimize impact.
Techniques that may be used for accommodating the new 16.0 behavior include:
06-20-2017 07:40 AM
I think the best idea is indeed to set an expression for the 'displayable' option instead.
And thanks for posting Release Guide Section, Hal. I wasn't aware of that fix, or side-effect of a fix