In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

OR condition not working in Filter tool

barb_mooney
5 - Atom

Can anyone tell me why this filter is not working and how to fix it? I used a select tool to format the Invoice Date column as DateTime and I also tried it formatted as just Date

 

The invoice date column comes in formatted like this

2019-01-31

 

DateTimeYear([Invoice Date]) = 2019
AND
DateTimeMonth([Invoice Date]) = 01
or
DateTimeYear([Invoice Date]) = 2019
AND
DateTimeMonth([Invoice Date]) = 02
or
DateTimeYear([Invoice Date]) = 2019
AND
DateTimeMonth([Invoice Date]) = 03

3 REPLIES 3
Thableaus
17 - Castor
17 - Castor

Hi @barb_mooney 

 

Here's a better version of your condition:

DateTimeYear([Invoice Date]) = 2019 AND DateTimeMonth([Invoice Date]) IN (1,2,3)

 

Or you could do this:

DateTimeYear([Invoice Date]) = 2019 AND DateTimeMonth([Invoice Date]) <= 3


Cheers,

 

barb_mooney
5 - Atom

Thanks! I used this option and it worked great

 

DateTimeYear([Invoice Date]) = 2019 AND DateTimeMonth([Invoice Date]) IN (1,2,3)

ChrisTX
16 - Nebula
16 - Nebula

Your original code would have worked if you used more parenthesis

 

(DateTimeYear([Invoice Date]) = 2019
AND
DateTimeMonth([Invoice Date]) = 1)
or

(DateTimeYear([Invoice Date]) = 2019
AND
DateTimeMonth([Invoice Date]) = 2)
or
(DateTimeYear([Invoice Date]) = 2019
AND
DateTimeMonth([Invoice Date]) = 3)

 

 

But @Thableaus code is more concise.

Labels
Top Solution Authors