Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Filter

SomuGS
8 - Asteroid

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!

8 REPLIES 8
OllieClarke
15 - Aurora
15 - Aurora

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

SomuGS
8 - Asteroid

Hi @OllieClarke 

Thanks for looking into this. Here are the screenshots. I tried with revised column headers

danilang
19 - Altair
19 - Altair

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 

OllieClarke
15 - Aurora
15 - Aurora

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

SomuGS
8 - Asteroid

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

SomuGS
8 - Asteroid

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

OllieClarke
15 - Aurora
15 - Aurora

@SomuGS glad to see it's fixed now, although I must confess I feel I'm going mad - @danilang mentioned autofield tools, but I swear I can't see any - and you said the datatype was a V_String in your initial post.

Regardless, good to see your problem's solved.

danilang
19 - Altair
19 - Altair

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

Labels
Top Solution Authors