Skip to main content
Solved

Testing an integer length?


smithgk
Contributor
Forum|alt.badge.img+6

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

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

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+30
  • Influencer
  • January 9, 2024

You can use the following in the TestFilter.

@StringLength(@Value(att)) < 6

 


smithgk
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 9, 2024
david_r wrote:

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!


Reply


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