Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Calculate Month over Month when Months are in Separate Columns

paulwini
7 - Meteor

Hi Everyone,

 

I'm looking to calculate the month over month change for each month in my dataset. However, I'm running into some difficulties because the month values are in separate columns (see input structure screenshot below) and the workflow needs to be dynamic to accommodate any future month columns that will be eventually added to the data. Ideally I would like the MoM change column to be located next to each respective month e.g. Jan-21 MoM will be located next to Jan-21 in the output (see desired output structure screenshot below).

 

The month over month column can just be null for the first month in the dataset since there will be no prior month's data to be used in the calculation.

 

Attached is the dataset containing an Input tab to be used in the workflow and a desired output tab for reference. Any help is appreciated.

 

Input Structure:

Input.png

 

Desired Output Structure:

DesiredOutput.png

 

Thank you,

Paul

 

8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @paulwini 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1629480237504.png

 

Hope this helps : )

paulwini
7 - Meteor

@atcodedog05 Wow thank you so much! Incredibly helpful. If I had additional data broken out by Sales & Count (see edited post & data), what would be the easiest way to accomplish the desired output using your methodology?

atcodedog05
22 - Nova
22 - Nova

Hi @paulwini 

 

Can you provide sample data its hard to work without it.

atcodedog05
22 - Nova
22 - Nova

Hi @paulwini 

 

2 values was bit more complicated. I have duplicated the data for sales and count.

 

Here is how you can do it.

Workflow:

atcodedog05_0-1629483110537.png

 

Hope this helps : )

paulwini
7 - Meteor

Hi @atcodedog05  my end goal has changed a little in that I would like all MoM fields to be at the end of the data. So the output would be in the format of the Desired Output tab in the attached Excel file. Is this possible?

atcodedog05
22 - Nova
22 - Nova

Hi @paulwini 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1629871720955.png

 

Hope this helps : )

paulwini
7 - Meteor

@atcodedog05 Incredible! Appreciate all your help so much. Thank you

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @paulwini 

Cheers and have a nice day!

Labels
Top Solution Authors