Alteryx Designer Desktop Discussions

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

Multi Column filter

elclark
8 - Asteroid

Hello - I'm trying to filter my file based on two columns, Days to Next Purchase and Days since Prior Purchase. I want my results to include any transaction that has a number between -3 and 3 in the Days to Next Purchase column or the Days since Prior Purchase column. I've tried various combinations of using OR/AND in my statement but I still end up with results in the false output that should be true. Is there a way to do this with a filter?

 

[Days to Next Purchase]<=3 AND [Days to Next Purchase]>=-3 

AND

[Days since Prior Purchase]<=3 AND [Days since Prior Purchase]>=-3

 

Here is an example of how I would expect them to be filtered.

 

Transaction #Days to Next PurchaseDays since Prior PurchaseFilter Results
1-5-5FALSE
2-4-1TRUE
3-321TRUE
4-222TRUE
5-10TRUE
601TRUE
715TRUE
8210TRUE
9345TRUE
10455FALSE
1153TRUE

 

 

3 REPLIES 3
mmish
6 - Meteoroid

Using your logic and changing the AND to an OR statement in the Filter is working as you specify.  Are there data points you are using that are not working?

 

[Days to Next Purchase]<=3 AND [Days to Next Purchase]>=-3

OR

[Days since Prior Purchase]<=3 AND [Days since Prior Purchase]>=-3

 

 

apathetichell
19 - Altair

if abs([days to next purchase])<=3 and abs([days since prior purchase]) <=3 then "true" else "false" endif

Qiu
21 - Polaris
21 - Polaris

@elclark 
Maybe we should consider a dynamic way, in case your columns number or name would change.

0528-elclark.PNG

Labels