Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula to select rows based on paritions

champ24
7 - Meteor

Hello,

 

I am trying to select data if a month exists in a given date range. The formula I am using in the filter tile is:

([YEAR]=datetimeyear([START_DATE]) or [YEAR]=DateTimeYear([END_DATE])) and ([MONTH] >=DateTimeMonth([START_DATE]) and [MONTH]<=DateTimeMonth(END_DATE]))

 

It works if a person has only one single date range. But if a person has multiple date ranges then its not excluding data correctly. Below is the snapshot of input and expected output. Months 5,6,7 doesnt exist in the start_date and end_date ranges and those rows shd be the output.

 

alteryx1.JPG

 

Is this possible?

13 REPLIES 13
champ24
7 - Meteor

Thank you all. a222 is still showing all rows. As I mentioned earlier it should show only these

a22220201Barista John
a22220202Barista John
a22220203Barista John
a22220204Barista John
a22220205Barista John
a22220206Barista John
champ24
7 - Meteor

I created the workflow and seems to be working correctly. The only way it seems to be possible is to exclude the specific rows and handle separately through a couple of filters and then union.

atcodedog05
22 - Nova
22 - Nova

Hi @champ24  is there any specific logic for only those rows to be outputted.

champ24
7 - Meteor

The logic I am using is to exclude End_date with nulls and then adding a filter on it.

Labels
Top Solution Authors