Hi,
what does the MapInfo value look like if you send it to the Inspector or the Logger?
If I create an attribute using the AttributeCreator and leave the "Value" column empty, the Tester works as expected with "Attribute is empty": is passes.
David
Hi David,
if a value exists:
2013-11-14 11:06:12| 0.4| 0.0|INFORM|Attribute(encoded: cp1252) : `NENNER' has value `1'
The StringLengthCalculator says:
2013-11-14 11:06:12| 0.4| 0.0|INFORM|Attribute(encoded: utf-8) : `_length_NENNER' has value `1'
#################################
If no value exists, the attribute NENNER doesn't exists.
The StringLengthCalculator says:
2013-11-14 11:06:12| 0.4| 0.0|INFORM|Attribute(encoded: utf-8) : `_length_NENNER' has value `0'
Kind regards
Thomas
When you say: "If no value exists, the attribute NENNER doesn't exists.", does that refer to a feature where there is no attribute called NENNER at all? If so, you will have to test with "Attribute is null" rather than "Attribute is empty".
For an attribute to be considered empty, the attribute needs to exist and have an empty string value.
For an attribute to be considered NULL, it should not exist at all (this will change in FME2014). In other words, removing an attribute is identical to setting it to NULL.
David
Oh, and note that the StringLengthCalculator will report length = 0 regardless of whether the attribute is empty or doesn't exist at all...
David
Thank you for the additional information David.
In these cases, the attribute NENNER doesn't exists indeed. It's doesen't show up in the inspector too. I didn't know that this would be possible, but obviously it does. The table view in MapInfo GIS suggests that there is "something" there (an attribute, even an empty one), but the FME knows better and tells me that there is nothing.
If I filter for NENNER is NULL, I get the right result. The attribute doesn't show up in the Feature Information (the right window) in the inspector as expected, but it shows up (with empty values) in the Table View. Even if no values are present in all entries of the attribute.
Kind regards
Thomas
One more question:
The test for NENNER = "" (empty string) and NENNER with the operator "Attribute Is Null" gives the same objects. Is this the right result?
Kind regards
Thomas
I just tested using FME 2013 SP4 and it does not behave like that. The Tester correctly makes the distinction between an empty string (attribute is empty) and not present (attribute is null).
That being said, I've always been a proponent of a more standardized NULL handling in FME and I really do look forward to the improvements in FME 2014.
David
Yes, looking forward to FME 2014 too. A colleague just tested it with SP4, with the same effect. The test for an empty string and for "Attribute Is Null" reveals the same result.
I find the distinction between empty and Null very usefull in scripts.
I can make an overlay i.e. between buildings and some parcel and route all features to 1 transformer, avoiding duplicate transformers etc. or just cause i want to do same operations on em.
Testing for existence of an attribute then gives a good test to separate the sets when needed.
This eliminates lotta clustering or stacking of transformers. I get more flat (horizontal workbenches)
Also combining 2 tests; attruibute exists OR attribute is empty is very common to me when using complex spatial realtions on multiple sources.
Of course an attribute showing in a table is pretty logical if it is somehow a join of mutliple tables those. Doesnt mean its actually there.
removing the distinction would mean i have to adapt some scripts...