Free Trial

Alteryx Designer Desktop Discussions

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

How to calculate difference bet 2 months if only 1 month has value

bui195
7 - Meteor

I'm trying to create a workflow to dynamically calculate month over month variance. My current formula only calculates the difference if the GL account and Client ID combinations exist in both current month and prior month. In the scenario that client ID and GL account combinations only exist in current month (or vice versa), it should take current month subtract 0, or 0 subtract prior month and show result in the MoM Variance column. 

 

Example below: 

 

Input:

 

bui195_1-1678739350334.png

 

 

Expected output:

 

bui195_0-1678739327057.png

 

3 REPLIES 3
BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@bui195 should be completely dynamic. It also doesn't matter the order in which the effective dates are entered into the workflow.

BS_THE_ANALYST_0-1678741377759.png

 

 

All the best,
BS

LinkedIN

Bulien
binuacs
21 - Polaris

@bui195 Another way of doing this

 

binuacs_0-1678744766739.png

 

bui195
7 - Meteor

Thank you so much! This works really well and simplify my actual workflow. I have a follow up question tho. How can I dynamically re-order column if next month I add March and the report should show January, February, March (the end goal is to show January to December as we go toward year end). With the Tile tool, I can see we assign the 2 most current months number 1 and 2 and the previous months will be assigned 3, 4, 5, etc. With March data coming in next month, I see it will show 2/28/2023, 3/31/2023, 1/31/2023 then MoM Varianc column. Do you have suggestions on how I can dynamically move the previous months the beginning so the months will be in the correct order?

Labels
Top Solution Authors