Alteryx Designer Desktop Discussions

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

How to create a dynamic filter using a macro

CesarSanchez10
6 - Meteoroid

Hi - 

 

So I'm having some difficulty creating a simple macro. All I need is to be able to filter some dates dynamically. There are 73 conditions within my data so I'm trying to avoid creating 73 filters. So I think a macro is the right approach..

 

I have company data with the column "Trade Date" and want to filter them based on the table below...

 

Min_Trade DateMax_Trade DateExpression
2012-12-312013-01-31[Trade Date] >= '2012-12-31' and [Trade Date] <= '2013-01-31'
2013-01-302013-02-28[Trade Date] >= '2013-01-30' and [Trade Date] <= '2013-02-28'
2013-02-272013-03-28[Trade Date] >= '2013-02-27' and [Trade Date] <= '2013-03-28'
2013-03-272013-04-30[Trade Date] >= '2013-03-27' and [Trade Date] <= '2013-04-30'

 

 

Currently I do it manually and I'm using the expression column to filter the data but ideally, I would like to use the Min_Trade Date and Max_Trade Date values to create a batch macro 

which does this for all 73 months dynamically.

 

Is there a smart way of doing this?

 

Thank you very much for the help!

 

10 REPLIES 10
CesarSanchez10
6 - Meteoroid

Wow....This worked like a charm!

 

Thank you and everyone else! 

 

 

Labels