Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Find difference between the values of the current and previous row for every field

jjiangDSAU
5 - Atom

I have a table with the following format:

 

Field1Field2Field3
1110
238
375
4151

 

I want to overwrite every value with the difference between that value and the value in the previous row, for every field. (For an arbitrary number of fields.)

 

Thereby creating the following table: 

 

Field1Field2Field3
000
12-2
14-3
18-4

 

I assume the key is the multi-row formula tool but I'm afraid the needed logic is a bit beyond me. 

Would appreciate any help. Thanks a lot. 

2 REPLIES 2
prakharalteryx
5 - Atom

You can use transpose and multi row logic combination to calculate the difference for each column. I have attached the workflow, let me know if you are good with it 

 

jjiangDSAU
5 - Atom

Works like a charm, thank you Prakhar. 

Labels
Top Solution Authors