Solved! Go to Solution.
@danchips24 - You can examine the trend using Scatterplot or TS Plot for time series data.
Using this for slope...
I built this example to calculate slope where Y is purchases and X is time (months) -
Hi @danchips24
Wondering if this macro would be helpful. https://gallery.alteryx.com/#!app/Least-Squares-Regression--Slope--Intercept-/5ab4ff0f8a9337138c471a...
There are macros available to pull the regression calculation from a linear regression tool as well. Take a stroll through the public gallery to find more.
Let me know if that helps!
Cheers,
Esther
Just wanted to follow up and mention that I did end up using this approach but instead of just looking at beginning to end, I had the summarize tool drill down further to show week by week purchases. This allowed for the slope calculation to be performed for every week throughout the year. Then by averaging the slopes throughout the year I was able to come up with a reasonable trend line for each supplier and filter by suppliers that had negatively trending slopes.
Thanks for the help!
Hi @danchips24,
I was doing a similar exercise and while searching came across this thread. I know you found a solution but thought I'd share mine as well in the event others are doing this same task.
I ended up building a macro that calculates the slope of two points based on a given interval and date format (week, month, quarter, year). For example, if the users specifies that they would like 3 weeks or 4 months, the slope will calculate based on those selections. You also have the ability to run this on multiple metrics if for instance you had Sales and Volume. Lastly, the macro is configured as a batch macro where the control parameter can be specified as Company, allowing a group by of that field.