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

Difference in Days

Scheruku
8 - Asteroid

Hi All,

 

I'm trying to calculate the difference in days if there is consecutive disconn and re conn for the same customer.The final column is Difference in days. Below the output:

 

CustomerZnDtActDiff
67049AM16-Mar-17Disconnection 
67049AM22-Mar-17Reconnection6
67049AM15-Sep-17Disconnection 
67049AM18-Sep-17Reconnection3
67074AM23-Feb-17Disconnection 
67074AM25-Feb-17Reconnection2
67078AM15-Jun-17Reconnection 
67098AM22-Jun-17Disconnection 
67098AM05-Jul-17Reconnection13
67018AM07-Jul-17Disconnection 
67018AM13-Jul-17Reconnection6
67138AM26-Aug-17Disconnection 
67328AM06-Jun-17Disconnection 
67328AM06-Jun-17Reconnection0

 

Please help.

 

Best Regards,

Scheruku

 

3 REPLIES 3
mceleavey
17 - Castor
17 - Castor

Hi @Scheruku,

 

Can you give more information on what you're trying to achieve as it looks like you've achieved it. I'm not sure what you're asking.

 

Thanks!



Bulien

jdunkerley79
ACE Emeritus
ACE Emeritus

I would suggest the following:

2017-11-23_11-14-48.jpg

 

First, parse the Dt column into Alteryx form (yyyy-MM-dd)

Then sort the data by Customer and then Date

Finally, use a MultiRow formula to compute date diff. Expression of:

IIF([Act]="Reconnection",
DateTimeDiff([Dt_Parsed],[Row-1:Dt_Parsed],"days"),
NULL())

Sample attached

Scheruku
8 - Asteroid

This is some great stuff... Thank you very much for your time.

Labels
Top Solution Authors