Before talking about Month-over-Month in Alteryx let's take a step back. What is Month-over-Month (MoM)? MoM growth shows the change in the value of a metric as a percentage of the previous month's value. This is a common way to assess your product or company's success. In Alteryx, there is 3 steps to achieve this. You can use the same logic for Year-over-Year calculation.
- Generate the previous month column
- Self join to get the month's value on the same row as the previous month's value
- Calculate the percent difference from previous month
Calculate the Month-over-Month in Alteryx: step by step
Below, this is the dataset used for the demo. For clarity, it contains only the sales by month for 2 product A and B.
Alteryx Month-Over-Month - Step 1
First step is to calculate the previous month, by using a formula tool and the DateTimeAdd formula. If your date field is in string format, you should use the DateTime tool to convert it. Find how to use it in this blogpost https://theinformationlab.nl/en/2020/09/28/how-to-turn-a-string-into-a-date-in-just-two-steps/.
Alteryx Month-Over-Month - Step 2
Now that we have this new column with the previous month, we can self-join the table by using month and previous month as a key. Previous month should be in the left key and Date (Month) should be in the right key. The Join tool can be used as a Select tool so we can deselect the fields not needed and rename the field 'Right_sales' as 'Sales previous month'.
In the L output, there are one month which didn't match from the input. January 2020 because we don't have the previous month (December 2019) in our dataset. We don't want to miss this month so we use Union tool right after to gather the left and the join output.
Alteryx Month-Over-Month - Step 3
Then the last step is to calculate the percentage difference from previous month with a Formula tool.
Below this is the result you obtain: a new column with the percent difference of sales from previous month!