We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Difference amount from Previous Month

JJ523
6 - Meteoroid

Hi, I have data with amount spread across categories by columns and months by rows as listed below. Need help to find the difference from previous month for each product line dynamically for every month run. Appreciate your help on this.

 

ProductMonthCategory ACategory B
Prod A8.20212030
Prod A9.20214050
Prod A10.20216040
Prod B9.202125

40

Prod C10.202150

80

 

Result should be like below

 

ProductMonthCategory ACategory B
Prod A8.20212030
Prod A9.20214050
Prod A10.20216040
Prod ADiff20-10
Prod B9.202125

40

Prod BDiff-25

-40

Prod C10.202150

80

Prod CDiff50

80

5 REPLIES 5
fmvizcaino
17 - Castor
17 - Castor

Hey @JJ523 ,

 

Here is an example for you. Since you need to get the difference between different rows for multiple columns, we need to use the multi-row + cross tab + transpose configuration in order for that to work.

fmvizcaino_0-1638198561620.png

 

 

 

Best,

Fernando Vizcaino

JJ523
6 - Meteoroid

Hi fmvizciano, thank you for the quick response. Prod A is showing correct difference however, Prod B and C not. Please check and verify

fmvizcaino
17 - Castor
17 - Castor

Hey @JJ523 ,

 

I was missing a group by in the multi-row tool. Also just noticed we don't have the information for the current month in product B, so I've created an additional step to include the most recent month from your dataset for all products (of course, you can remove it later by filtering the values = 0)

 

Best,

Fernando Vizcaino

JJ523
6 - Meteoroid

You saved my day. Thanks a ton 😀

fmvizcaino
17 - Castor
17 - Castor

You are so welcome @JJ523 !! 😁

 

Happy Alteryx-ing!

Labels
Top Solution Authors