Skip to main content
Solved

Testing an integer length?

  • January 9, 2024
  • 3 replies
  • 46 views

smithgk
Contributor
Forum|alt.badge.img+9

Hello, is there a way to test an integer's length within the TestFilter transformer? I have an integer column that can be freely populated with values, but I need to flag rows that are not 6 characters long. Is there some operation in the Test Clauses window that I can use to test for this?

Best answer by david_r

You can use the @StringLength() function, for example if your integer column is called "num":

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.

3 replies

david_r
Celebrity
  • Best Answer
  • January 9, 2024

You can use the @StringLength() function, for example if your integer column is called "num":

image


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • January 9, 2024

You can use the following in the TestFilter.

@StringLength(@Value(att)) < 6

 


smithgk
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • January 9, 2024

You can use the @StringLength() function, for example if your integer column is called "num":

image

Oh that is it! Thanks so much David. I had found the @StringLength function but wasn't nesting it with the @Value function. Right before you posted this, I was testing using the StringLengthCalculator to create temporary attributes and test them. This solution simplifies things a lot for me, thanks again!