We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback

Challenge #17: Month-over-Month Retention Rate

Alteryx Alumni (Retired)

Here is this week’s challenge, I would like to thank everyone for playing along and for your feedback. The link to the solution for last challenge #16 is HERE. This week’s assignment is listed as an advanced exercise due to the requirement of using a batch macro for the solution.


The use case: A bank is looking to calculate customer retention rate month over month. The denominator in the calculation are all of the accounts open 24 months prior to the start of the month. For example, for June 2013, the denominator would be the total number of accounts open between June 1, 2011 through May 31, 2013. The numerator will be total number of accounts closed in June 2013 or between June 1, 2013 through June 30, 2013.


The objective is to create a batch macro that calculates the retention rate for May, June, July and August.


The solution has been uploaded

Tara McCoy
11 - Bolide

It's nice to see the macro answer and learn something new!  I got stuck on this one since I was trying to do it without adding a start of month table and I have very little experience with macros.  I was able to solve it without using a macro and without having to manually add a Start of Month table.  I had one hard coded filter to remove activity prior to May 2013 so that my results matched the same date ranges shown in the solution.  It doesn’t really need to be included to make this work.  The 24 month criteria for calculating the numerator (open accounts from prior 24 months) is also hard coded based on the directions.  Everything else is dynamic so that if you had accounts older than 24 months they would not be included in the calculation nor would you need to add a record in the Start of Month table to include September 2013.  I annotated the best I could while trying to keep the canvas clean.  I could have added tool containers, but I need to move on.  I chopped it into 2 pictures so that it is legible.  I’d be happy to answer any questions on the workflow formulas.



17 - Castor
17 - Castor

Quite a different approach within the Batch macro from @GeneR's (or @TaraM's) solution, but the inputs to the batch macro are very similar.


- Added a set of fields to make maintanability easier and the logic more obvious:
    - One for the control param being the month in question
    - one for a date 24 months previous
    - one as a boolean flag to say "is this account open right now"
    - one as a flag to say "did this account close in the window in question" etc
- Then we just take a sum across these flags
- Then, same as @GeneR / @TaraM, calculate the ratio and send out to the calling macro

I didn't use the control param through an action component - but instead straight into a formula


ACE Emeritus
ACE Emeritus

My solution. Watched the webinar on Batch Macros today, so this one was perfect practice :) Pretty pleased I was able to do this one in just a few tools!


Note: The instructions indicate numerator is Open & denominator is Closed, but then results in the start file have it showing calculated as the opposite. In addition, I believe to be accurate with identifying a true "Retention Rate," you'd want to know the # of customers remaining after closed accounts... so wouldn't it be (Open - Closed)/Open? Just a thought. I solved for both in my solution, just in case!


15 - Aurora
15 - Aurora
11 - Bolide

Here is my solution! 

8 - Asteroid

This one was a struggle for me, but finally managed to solve and it looks to be similar to other solutions.

15 - Aurora

I had to look at the solution for this to help get my Open/Close formula correct :(


Weekly Challenge 17.png
17 - Castor
17 - Castor