Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Filter Dates

Muhammad
7 - Meteor

I'm trying to dynamically filter my data as per below. This workflow need to run (automatically) every month. Would really appreciate if someone can attach a sample workflow.. Thanks.

[Request 2] column = Filter Current Month (Apr) and Last Month (Mar) dates

Then from [Request 1] column = Filter only previous months (Mar and prior - exclude current month dates)

 

Data Set:

Request 1Request 2
2019-04-072019-04-08
2019-04-052019-04-08
2019-04-022019-04-08
2019-04-012019-04-02
2019-03-292019-04-03
2019-03-282019-04-07
2019-03-262019-04-02
2019-03-222019-04-05
2019-03-112019-03-12
2019-02-222019-03-01
2019-02-222019-04-02
2019-02-212019-03-22
2019-02-012019-04-05
2019-01-312019-02-01
2019-01-012019-01-03
2018-12-112019-04-02
2018-03-112019-03-03

 

Desired Output:

Request 1Request 2
2019-03-282019-04-07
2019-03-262019-04-02
2019-03-292019-04-03
2019-03-222019-04-05
2019-02-212019-03-22
2019-02-222019-03-01
2019-02-012019-04-05
2019-03-112019-03-12
2019-02-222019-04-02
2018-03-112019-03-03
2018-12-112019-04-02
2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @Muhammad 

 

Filter Tool with this formula:

 

Filter.PNG

 

ToNumber(DateTimeFormat([Request 2], "%y%m"))
>= ToNumber(DateTimeFormat(DateTimeNow(), "%y%m")) - 1 AND
ToNumber(DateTimeFormat([Request 1], "%y%m"))
<= ToNumber(DateTimeFormat(DateTimeNow(), "%y%m")) - 1

 

Cheers,

Muhammad
7 - Meteor

You're great! Thank you so much!!!

Labels