Skip to main content
Solved

How can I test if an attribute value is of type INTEGER regardless which size?

  • November 7, 2017
  • 5 replies
  • 265 views

kalbert
Supporter
Forum|alt.badge.img+14

The TESTER transformer let pass only 32bit INTs when using 'type is' Integer as operand. I need to test if the value is 64bit Integer or smaller (but no double or float).

I used also AttributeValidator with the same result.

 

Best answer by erik_jan

You can use the test in the Tester:

Attr1 = floor(Att1) as in the image.

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

5 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • Best Answer
  • November 7, 2017

You can use the test in the Tester:

Attr1 = floor(Att1) as in the image.


david_r
Evangelist
  • November 7, 2017

I can confirm that using FME 2017.1 and the AttributeValidator to check for "Is Type Integer" is equivalent to checking if the attribute is a signed 32-bit integer, i.e. in the range -2,147,483,648 to 2,147,483,647.

Anything outside that range will fail.

The tip from @erik_jan is a good workaround.


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • November 7, 2017
I filed this with the developers as PR#80373, so hopefully we'll get this improved upon.

 

 


kalbert
Supporter
Forum|alt.badge.img+14
  • Author
  • Supporter
  • November 8, 2017

@erik_jan

Many thanks, a great solution. Teaches me that it's worth looking closer at all the math functions (e.g. @uint64(@value(Att1)) works as well).


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • November 28, 2017
I'm told this is fixed in FME2018, although I don't know the specific build number.

 

 


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