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.

Subtracting from same column and show difference and percentage change in new columns

limats
7 - Meteor

Hi everyone,

 

Please may I ask hopefully a simple question; I have the below input data which I am trying to find the change per quarter by subtracting a row below from the row above for each row, and also the percentage change in two new columns. I would like to have the data presented in exactly the below format. 

 

Any help would be much appreciated - many thanks in advance!

 

Input

DateAmount 
4Q141000
1Q15800
2Q15600
3Q15500
4Q15700
1Q161000
2Q161200
3Q16900
4Q16800

 

 

Desired Output

DateAmount Delta % Delta 
4Q141000n/an/a
1Q15800-200-20
2Q15600-200-25
3Q15500-100-17
4Q1570020040
1Q16100030043
2Q16120020020
3Q16900-300-25
4Q16800-100-11

 

2 REPLIES 2
RishiK
Alteryx
Alteryx

@limats have a look at the attached sample workflow I built for you.

 

RishiK_0-1630015951661.png


The Multi Row Formula tool really helps here when you are referring to the "row above" or "Row-1" and applying a calculation on your "Active Row".

 

Have a look and let me know what you think.

Qiu
21 - Polaris
21 - Polaris

@limats 
Just trying a different approach.

0827-limats.PNG

Labels
Top Solution Authors