Skip to main content

I want to convert the format of a date-attribute from %Y%m%d to %Y-%m-%d by using the DateTimeConverter. This works fine, as long as there are no Null-values. As soon as there is just one Null-value, all other values are set to Null as well (even though the option “Passthrough Nulls, Empties or Missing” is set to Yes).

I tried to filter out the features with the Null-values, convert just the features with values and merge all features after the DateTimeConverter again, but here too, all attributes are set to Null.

If I set the Null-values to a dummy-date, then it works. But I don't want dummy-dates, but Null-values, so how do I do this?

Thanks in advance, Vera

Perhaps a sample/screenshots of the workspace and Transformer configurations?

DatetimeConverter will only Null for the selected Attributes where they have an invalid format against the Date/Time pattern being tested.   So Nulling all Attributes should only happen if All Attributes have been accidentally selected to convert rather than selecting  just the Attribute(s) wishing to convert.


Here are some screenshots. Obviously, in the transformer the type of the data changes from date to buffer, but this happens not just for the Null-values, but the dummy-data as well.


What version of FME are you using? I just tried in 2022.2, 2023.1 and 2024.1 and it worked as expected


I have found the error. It has always worked correctly. I had looked at the results with the ‘Visual-Preview’-Tab by sorting the corresponding column ascending and descending. That way I only saw zero-Null-values (the majority are Null-values) and I missed the fields with the correct date formats, even though they always would have been there…

 


Reply