Troughput between repeating activities A and B

Hello everyone,
I have 2 activities, A and B and I would like to calculate the throughput between them. It can happen, that A and B appear multiple times but B always appear after A;
so I am interesten in the pairwise calculation of the throughput time (and average of that).
Example:

F-A(1)-C-B(1)-A(2)-B(2)-N-A(3);

In this case I need the average time between A(1)-B(1) and A(2)-B(2).

any ideas?

Best,
Maria

Hi Maria,

you can do that by using SOURCE TARGET function and remap every activity than A and B to null.

AVG(
DAYS_BETWEEN ( 
SOURCE("ACTIVITIES"."EVENTTIME",
REMAP_VALUES ( "ACTIVITIES"."ACTIVITY_EN",['B', 'B'], ['A', 'A'] , NULL)), 
TARGET ( "ACTIVITIES"."EVENTTIME",
REMAP_VALUES ( "ACTIVITIES"."ACTIVITY_EN",['B', 'B'], ['A', 'A'] , NULL))
)
)

Hope this helps,
Viana