Get Count of two temporal related Tables


I want to create an OLAP Table, which has the Activity Name as Dimension, Count of other Table within a specific time and the mode of the count as KPIs. Both tables have timestamps and the same ID (see attached image with explaination

Unfortunately, I have no idea of how to do this with the PQL statements and tried various things but none were successful.
I’m using Celonis on-premise 4.6.

I would appreciate any help here.