Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Cohort Change -- Diagonal Calculation

abrasch
8 - Asteroid

I'm hoping to achieve the same result in Alteryx as a simple set of calculations in Excel. The data is structured like the screenshot below (Excel file attached). The goal is to calculate the ratio of change over time for a given cohort (e.g., K cohort in 2017 moves into 1st grade in 218, gaining 6 students, or a ratio of 1.061). Any help would be much appreciated.Cohort Change.png

4 REPLIES 4
flying008
14 - Magnetar

Hi, @abrasch 

 

There is a rapid method for you reference, but i can't upload any .yx** file to web, So perhaps someone else can solve this problem in a conventional way.

 

录制_2023_11_03_15_16_35_867.gif

 

Input      
Grade201720182019202020212022
09810285867782
111910493859689
210112093919592
31051141029389110
41311161161017982
51251311141149587
       
       
Output      
Grade Ratio 2017 to 2018Ratio 2018 to 2019Ratio 2019 to 2020Ratio 2020 to 2021Ratio 2021 to 2022
0      
1 1.061224490.91176470611.116279071.155844156
2 1.0084033610.8942307690.9784946241.1176470590.958333333
3 1.1287128710.8510.9780219781.157894737
4 1.1047619051.017543860.9901960780.8494623660.921348315
5 10.9827586210.9827586210.9405940591.101265823
Qiu
21 - Polaris
21 - Polaris

@flying008 
The Diagonal tool looks interesting.

@abrasch 
I have to choose a batch macro for this one.

I pick up one year and the year after it for each batch.
And I iike this question, maybe we can submit it for the weekly challenge?

1103-abrasch-A.png1103-abrasch-B.png

abrasch
8 - Asteroid

@Qiu 
Thank you for the quick response. I was having an issue with the year-to-year nature of the data restructuring that had to occur--great solution with the batch macro! I tested and it worked as expected and will be scalable in terms of adding more grades and years. Thanks again for you help. I will submit it as an idea for the weekly challenge.

@flying008 
That looks nifty! It would be interesting to see the inner workings of the macro.

Qiu
21 - Polaris
21 - Polaris

@abrasch 
Really happy to know it helps and thank you for great feedback.

Have a good one.😀

Labels