Skip to main content
Question

Handling NaN values

  • May 9, 2023
  • 1 reply
  • 196 views

Forum|alt.badge.img

I have a workspace that can sometimes generate some NaN-valued Real64 data types (from the surface draper specifically). 

 

I'm really struggling with how to handle these. FME seems very inconsistent with how I can test them. I would like to test for them and terminate the workspace if they are found. 

 

So far I have tried:

  • Attribute Validator by type (numeric)
  • Attribute Validator by 'Has a Value' 
  • Attribute Validator by 'Not Null' 
  • Tester by all of the above

 

The only thing I was able to get to work is a tester using 

@abs(@Value(MyMaybeNANAttribute)) < 0.00000000000000000000001

where I just used the number on the right as an arbitrarily small floating point number. This evaluates to True for my nan values, so I can filter them out. However, this is not a good workaround because I can have valid zero value in some cases.

 

I have searched the forums and the articles and I have not had a good explanation of how NaNs are handled in FME. Is there a way I can catch these with a data validator or a tester? 

1 reply

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • May 9, 2023

Hi @mlindsvo​,

A NaN value will fail any numeric test, so use a Tester to see if the attribute in question equals itself, in Numeric mode. Only the NaN values will fail.


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