Skip to main content
Solved

DateTimeConverter and NULL values

  • August 29, 2024
  • 4 replies
  • 106 views

vki
Contributor
Forum|alt.badge.img+7
  • Contributor

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

Best answer by hkingsbury

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

View original
Did this help you find an answer to your question?

4 replies

bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • August 30, 2024

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.


vki
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • August 30, 2024

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.


hkingsbury
Celebrity
Forum|alt.badge.img+53
  • Celebrity
  • Best Answer
  • September 2, 2024

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


vki
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • September 4, 2024

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…

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings