Hey All,
I'm new to Alteryx, especially with creating and aggregating data within it, so bare with me.
I've got an excel data set I'd like to develop MoM, YoY and YTD calculations for each row of data.
My goals:
- Create these calculations for all KPI columns (median sale price, median listing price, etc)
- Add field for 'Prior Month', 'Prior Year Month' and 'YTD' that display the actual numbers from those field.
- Add fields for 'MoM', 'YoY, and 'YTD' as a percentage change.
- The data is either ZIP code level OR MSA level. If no Zip, then its already aggregated to MSA
- Same applies for Year, except we compare it to the prior year, same month and develop a percentage change.
- For YTD, its YTD average / YTD Average (given same months) of year prior.
I've attached the data in a workflow for review. Again, I'm new to this all, but willing to work to understand it all if someone could help with some best practices in this area and how to.
Thanks!
I'm trying to avoid calculating these in Tableau to increase dashboard speeds.
Solved! Go to Solution.
Hi Shap,
In the future you'll want to export your workbook otherwise we can't see the data you're reading.
Export:
Without knowing your data set I can't be specific, but the general calculations you're looking for are below:
(I've used random sample data)
Sample Data:
Mean Price (Sale, Listing, etc.):
Use the summarize tool
Prior Month:
Use the multi-row formula tool
Prior Year Month:
Now this can get tricky. If your data is organized like the sample data set you can use the multi row formula tool referencing the price 12 months ago --> [Row-12:Price].
If not, it's more complicated (we don't know if there's one price or multiple prices per month. If so, will we take the min, mean, or max price. We'll need a separate formula(s) to determine the record ID. etc.)
YTD (Assuming mean price YTD):
Use the multi-row formula tool twice (one create record ID's, the other to take mean)
Flow:
Increment Record ID's:
Calculate YTD:
MoM (%):
Once we collect prior month price this is easy. Use the formula tool.
Flow:
Formula:
YoY (%):
Flow:
Formula:
YTD (%):
Flow:
Formula:
The formulas covered in the first part will get you most of the way there. You have so many columns that all of them need to be processed with the transpose tool and cross tab tool.
(An essential part of transpose/cross tab is add a record ID tool right before so everything lines up at the end)
I've attached the modified workflow.
Flow:
Results:
Transpose:
Cross Tab:
Hey Josh,
This is probably the most comprehensive and helpful response in a forum I've ever received. Both extremely helpful in learning new processes and will save my countless hours banging my head on the desk. GREATLY appreciated.
I am not able to open the packaged workflow however. Looks like I'm running version 10.6.8.17850 of Alteryx. Is it possible for you to downscale and resave?
Again, thank you very much for the detailed step by step.
Happy to help!
Try this attachment. I followed the steps here to try and turn it into v10.5. Let me know if you need a prior version from that. (You might be able to adjust the version using it as well if it still doesn't work)
(attaching both a regular workbook and the extract just in case)
The regular workbook opened, but not the extract. Workbooks works fine.
Ok I'm going to dig into the provided workbook and then I'll try reduplicating the process using your instructions so I get a better understanding of how you did it.
Again, thank you!
I thought I would show a small adjustment to @JoshKushner workflow.
The principles are exactly the same but it does each period in parallel. The required periods are defined in a text input:
and the starting date is computed using a formula tool
After this, the RefDate is joined back to data on Date to get RefValue.
Only a minor change from the great work @JoshKushner did but felt worth sharing.
Workflow attached in 10.5 format
@jdunkerley79 thanks for the Alt version. So does this reduce run time and simplify the stream a bit? Really looking forward to gaining more experience with alteryx.
I expect the performance to be similar. If anything it may be slightly slower as it will involve slightly more sorts than @JoshKushner
My reasoning for my tweaks is:
- doesn't require all months to present
- easier to add another period (e.g if you wanted quarter very small change)
- by having less tools easier to debug
That being said had missed a field on the join so had a bug. New version attached with it corrected.