Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Calculate difference between values in a previous and next day.

MaksimBI
6 - Meteoroid

Hi community,

How to calculate the "Difference" field? 

The data is as follows: 

DateValueDifference
01.01.20191000 
02.01.201910055
03.01.201910083

 

The "value" field is cumulative. Difference starts from day 2. Because we don't have data fro 01.01.2019 to compare with .

 

Thank you.

5 REPLIES 5
JohnJPS
15 - Aurora

Hi @MaksimBI 

 

Use the Multi-Row Formula tool: Difference = [Value] - [Row-1:Value]

 

Hope that helps!

John

MaksimBI
6 - Meteoroid

Hi @JohnJPS ,

Thank you, that helped.

RCurry1230
7 - Meteor

thanks for posting this question! Exactly what I needed!

franc1s
8 - Asteroid

I am wondering how I could obtain the difference between the columns in this data structure. The amount of columns should be dynamically determined, so when 202204 comes around, the difference to 202204 should be automatically determined.

franc1s_0-1652894678039.png

When using the multifield formula I am able to compare 202201 to 202202, and 202201 to 202203, but not 202202 to 202203.

I could reformat the data to the below table, and apply the multi-row formula, but, I am wondering how I could use the multi-field formula with the structure above..

franc1s_1-1652894716977.png

 

 

 

Thanks!

JohnJPS
15 - Aurora

Hi @franc1s

You can start with your 1st grid and just do a transpose (or maybe cross apply - I forget and don't have Alteryx in front of me at the moment) in order to achieve your 2nd grid. Then apply the multirow formula.

Hope that helps!

John

Labels