community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Difference in Days

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

 

Alteryx Certified Partner

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!

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

Asteroid

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

Labels