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
  • 344 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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

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

You can use the test in the Tester:

Attr1 = floor(Att1) as in the image.


david_r
Celebrity
  • 8394 replies
  • 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+56
  • Safer
  • 2554 replies
  • 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
  • 27 replies
  • 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+56
  • Safer
  • 2554 replies
  • November 28, 2017
I'm told this is fixed in FME2018, although I don't know the specific build number.