Hi,
I'm trying to apply custom filter to data that has both numeric values and strings (screenshot 1). I've set the data type to "V_Sting" and applied custom filter to the column to filter only if it contained "F" or "Y" (screenshot 2) using the below function in filter. However this is also picking up records that have "0".
Any help would be appreciated.
Thank you!
Solved! Go to Solution.
Hi @SomuGS the configuration of your filter looks correct to me. Could you share a screenshot of the data before and after the filter please - my only guess at this point is the column referenced is the wrong column...
Ollie
Hi @OllieClarke
Thanks for looking into this. Here are the screenshots. I tried with revised column headers
Hi @SomuGS
With that single record, there's a chance that the Autofield tools are setting it's type to Boolean. 0 in the Type field is equivalent to False and so your filter evaluates to False(0)=False("F") for a final value of True, thereby passing the record. Try explicitly setting the field type to a string type
Dan
Hi @SomuGS
thanks for the screenshots - to help even further please could you send 3 more screenshots:
1. showing the input anchor data of the filter tool (along with the tool configuration)
2. showing the T output anchor data of the filter tool (along with the tool configuration)
3. showing the T output anchor metadata of the filter tool (along with the tool configuration)
This should give us everything we need - and rule out/prove @danilang's theory too
I did also notice that the closing bracket of your IN statement is a different colour to the opening bracket, but I have no idea if that's relevant....
Hi @danilang,
Thanks for suggesting to use STRING type, this helped. Not sure if what you noted on the Autofield tools are setting it's type to Boolean.
Thank you!
Bharat
Hi @OllieClarke
Per Dan suggested solution it would and I was able to have filter work. Just in case if you need to look into the screenshots, I've attached them.
Thanks for helping on this.
Bharat S
Hi @OllieClarke
Depending on the input source type, there can be an AutoField functionality applied in the directly in the Input Tools. If the first 100 rows of the the input data contain only the values "T" and "F", the Input tool may set the field type to Boolean.
Dan