General Discussions

Discuss any topics that are not product-specific here.

Consecutive month

Pelumi50
5 - Atom

I need help with my data. I want to be able to find customers that purchased products within the last two months or less. It could be consecutive or non- consecutive. I have been able to separate the months into another column but I need help identifying customers within the last two months or less. 

3 REPLIES 3
IraWatt
17 - Castor
17 - Castor

Hey @Pelumi50,

The first step is to convert you text dates to a date data type. I do this with the date time tool. Next you can use a datetimediff formula to find the difference between the date and the current date in months:

IraWatt_0-1668463682869.png

Then you can filter based on the result. And summarize to get a list of customers:

IraWatt_1-1668463748874.png

If your interested in learning more about the datetime functions there is a great cheat sheet Blog here: https://community.alteryx.com/t5/Engine-Works/DateTime-Functions-Cheat-Sheet/ba-p/844353

 

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

 

IraWatt
17 - Castor
17 - Castor

Also @Pelumi50, for questions about workflows I would recommend the designer discussion board: Alteryx Designer Discussions - Alteryx Community

KevinHarrison
8 - Asteroid

If you are looking for anything within the last two months you could filter everything that is greater than datetimeadd(datetimetoday(),-2,'month') Or are you looking to customers last two month and could be separated by months.

 

That way you could sort by customer and sort by date in descending order and then sample tool the first 2 records grouped on customer.  

 

KevinHarrison_0-1668464304224.png

KevinHarrison_2-1668464399691.png

 

 

KevinHarrison_1-1668464370577.png

KevinHarrison_3-1668464420049.png

 

 

 

Labels