Solved

Testing an integer length?

  • 9 January 2024
  • 3 replies
  • 16 views

Badge +2

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?

icon

Best answer by david_r 9 January 2024, 18:15

View original

3 replies

Userlevel 5

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

image

Userlevel 3
Badge +26

You can use the following in the TestFilter.

@StringLength(@Value(att)) < 6

 

Badge +2

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