Alteryx Designer Desktop Discussions

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

How to Filter for multiple condition

Kuha
7 - Meteor

Hi, I am using the filter tool to exclude some data with the following conditions. I am not getting it right.

 

I want to exclude the records if one of the following conditions is met.

 

!IsNull([Project Code])

!IsInteger([Project code])

[Total Amount] != 0

 

I tried like this !IsNull([Project Code]) OR !IsInteger([Project Code]) OR [Sum of Amount] != 0

 

Any help would be appreciated. Thanks

 

Kuha

7 REPLIES 7
Luke_C
17 - Castor

Can you share some sample data? Try changing your ORs to ANDs.

BS_THE_ANALYST
14 - Magnetar

@Kuha maybe I'm stating the obvious, or have missed something:

BS_THE_ANALYST_1-1678577006164.png

What you want, and what you tried are two different things? Look at the highlighted parts. Yellow doesn't match yellow, etc

Kuha
7 - Meteor

First I wanted to say sorry for the mixup of the data field. The Row Label and Project code are the same and I have now corrected them in my original mail.

 

Here is the sample data:

 

What I am trying to do is extract some data from an existing Excel file. The Project code field is a string field and may have blanks and alpha characters.

 

What I am trying to do is: Exclude the line

If the Amount is 0

if the Project code is Alpha char or blank

 

I tried to filter it using 3 separate filters and it works fine. But I am trying to do this one filter.

Project codeSum of Amount
4122208.15
4124163.11
41250.00
41260.00
4127236.52
4128169.20
41340.00
Total776.98

 

BS_THE_ANALYST
14 - Magnetar

@Kuha hey, don't be sorry. Just wanted to check as a first line of defence if that was the case 😊.

I've updated the original data to contain some checks:

BS_THE_ANALYST_0-1678621219838.png

Output after applying your filtering conditions:

BS_THE_ANALYST_1-1678621264565.png

 

So, how to build what you wanted in the filter. 
The Sum of Amount field must not be 0 AND (project code is not null AND project code must be an integer).

You may not need the parenthesis around the last part, I just tend to put them there as it made sense in my head. It should still work without them as it's multiple AND statements.

 

Just as an added bonus, there's another way to filter using RegEx:

BS_THE_ANALYST_3-1678621484169.png

 

Sum of Amount !=0 AND project code only contains numbers 😀
In RegEx:
\d means a number
+ means one or more occurrences of this
\d+ therefore, means, one of more occurrences of a number (it will say false if any other characters are present).


 

 

 

Kuha
7 - Meteor

It works fine. Learn something new today. Thanks for all your help.

Kuha
7 - Meteor

xx

Kuha
7 - Meteor

Hi,

 

Sorry, I messed up here. I don't know how to change your response to the accepted solution.

 

Kuha

Labels