Most variants, days between two dates, days between first and last

ALMOHANNADI

New Member
Joined
Apr 21, 2016
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Dears,
Need your help on analyzing a process steps, I want to create I guess Pivot Tables to achieve:
  • Get most variants of workflow process (how many times followed the same steps for all variants).
  • Get the days between two days within Pivot table (each step).
  • Get the days difference between the first date per ID and the last date.
I have table with three columns:
ID Activity Timestamp
1 initiate 01/01/2019
1 endorse 03/01/2019
1 approve 05/01/2019
2 initiate 02/01/2019
2 rejected 06/01/2019
3 initiate 03/01/2019
3 returned 04/01/2019
3 initiate 06/01/2019
3 endorse 08/01/2019
3 approve 10/01/2019
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Well, it's not particularly pretty, but it seems to have everything you need.

Here's what I did.

I added the table to Power Query.
Added an Index column.
Loaded the table to connection only and checked the option to add the table to the data model.
In the data model, add a measure - MaxMinDiff:=MAX([Timestamp])-MIN([Timestamp])
Then add a column with the following formula...
Code:
=IF(

Table1[ID]=LOOKUPVALUE(Table1[ID],Table1[Index],Table1[Index]-1),

Table1[Timestamp]-LOOKUPVALUE(Table1[Timestamp],Table1[Index],Table1[Index]-1)

,0

)

Then in the data model, add a Pivot Table.

In the pivot table under Rows I have: ID-->Activity-->Timestamp

Under Values I have Activity as a count-->
The measure I created called MaxMinDiff-->
The column I created called DaysBetween as sum

Here's what the pivot table looks like.

Book1
BCDE
3IDStepCountMaxMinDiffSum of DaysBetween
413120120
5approve1061
65/1/20191061
7endorse1059
83/1/20191059
9initiate100
101/1/2019100
1122120120
12initiate100
132/1/2019100
14rejected10120
156/1/201910120
1635214214
17approve1061
1810/1/20191061
19endorse1061
208/1/20191061
21initiate29261
223/1/2019100
236/1/20191061
24returned1031
254/1/20191031
26Grand Total10273454
Sheet7
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top