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

Alteryx Designer Desktop Discussions

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

Custom Filter using AND error

HandsomeJih
6 - Meteoroid

Hi everyone, newbie here.

 

I tried using custom filter given multiple conditions, but it somehow fail for "malformed call".

I then attempt to change the data form but it doesn't work either, can someone help please?

 

I input below into the custom filter area:

(Length([ID number] = "7" AND Left([ID number], 1) = "9")

 

Thanks

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @HandsomeJih 

 

Try this formula

 

Length([ID number]) = 7 AND Left([ID number], 1) = "9"

 

Just a clarification you are trying to filter [ID number] of length 7 and starts with 9 right? if yes the above should work. Length is a number so it should be compared with 7 and not "7"

 

Hope this helps🙂

PhilipMannering
16 - Nebula
16 - Nebula

Hey @HandsomeJih 

 

You could try,

Length([ID number]) = 7 AND Left([ID number], 1) = "9"

You were missing a closing bracket around [ID number] and when you apply Length to a string field you return a number, so =7 not ="7"

Hope this works!

 

Philip 

Emil_Kos
17 - Castor
17 - Castor

Hi @HandsomeJih,

 

In the situation like this if you don't know how to resolve the issue. Try splinting your formula in smaller parts.

 

First split your formulas into smaller parts. Like:

 

Length([ID number] = "7"

Left([ID number], 1) = "9"

 

Thanks to this approach you could identify which part isn't working correctly and probably you would be able to sort out your issue yourself 🙂

 

Good Luck!

 

 

 

 

Qiu
21 - Polaris
21 - Polaris

@HandsomeJih 
Most likely, your "ID Number" field will be numeric, so we need to change it to string.

Length(tostring([ID number])) = 7 AND Left(tostring([ID number]), 1) = "9"

Capture123.PNG 

atcodedog05
22 - Nova
22 - Nova

Good point @Qiu 🙂👍

 

Thats also possible

HandsomeJih
6 - Meteoroid

Thank you every one for quick response and advise!!!

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @HandsomeJih 

 

Cheers and Happy Analyzing 😀

 

Feel free to reach out if you face any issues 🙂

Labels