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

Subtracting values from same column into new column

limats
7 - Meteor

Hi All,

 

I am trying to subtract values that are in a column i.e. subtract values from the row above for all the rows. I would like to also show the percentage change per row. I have the following input and wish to get the desired output as shown exactly below. Please can someone advise? 

 

Many thanks in advance

 

Input 

DateAmount 
4Q141000
1Q15800
2Q15600
3Q151200
4Q15950
1Q16700
2Q16800
3Q16700
4Q16500

 

Desired Output

DateAmount Change% Change 
4Q141000n/an/a
1Q15800-200-20
2Q15600-200-25
3Q151200600100
4Q15950-250-21
1Q16700-250-26
2Q1680010014
3Q16700-100-13
4Q16500-200-29
4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @limats 

 

Here is how you can do it. You can do this using multi-row formula tool.

Workflow:

atcodedog05_0-1628492503992.png

 

 

Interactive lesson on Multi-row formula tool:

https://community.alteryx.com/t5/Interactive-Lessons/Multi-Row-Formula/ta-p/82872

 

Hope this helps : )

messi007
15 - Aurora
15 - Aurora

@limats,

 

Please see below:

 

messi007_0-1628492507995.png

 

Attached the workflow. 

 

Hope this helps !

 

Regards,

limats
7 - Meteor

Thank you!

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @limats 

Cheers and have a nice day!

Labels
Top Solution Authors