Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Match Report DateTime to DateTime on Site

Bobbins
8 - Asteroid

Good Morning All,

Using Valet parking as the example, I am trying to find out when the valet issued a ticket so that it can be matched to the right period of time that the valet was in the parking lot.

 I have two files (both excel files), first is the ticket file. (This normally has 1000+ lines)
File 1

PersonDateTime for Ticket (yyyy-mm-dd hh:mm)Unique Code
a,smith2022-05-04 12:35A12
b,jones2022-05-05 15:45C54
a,smith2022-05-05 15:59AA59
c,charlie2022-05-05 21:21Z65
a,smith2022-05-06 01:32G56

 

File 2 9(This normally has 20000+ lines)

This file shows the entry and exit time of the person from the site. Often many multiples of entry and exit for people, including across a date shift)

PersonEntry (yyyy-mm-dd hh:mm)Exit (yyyy-mm-dd hh:mm)
a,smith2022-05-04 06:352022-05-04 15:35
b,jones2022-05-05 14:442022-05-05 16:13
a,smith2022-05-05 12:13 2022-05-05 16:50
b,jones2022-05-05 18:122022-05-05 23:58
c,charlie2022-05-05 19:212022-05-05 22:13
c,charlie2022-05-05 23:592022-05-06 06:15
a,smith2022-05-05 23:592022-06-06 12:15

 

This should eventually give us:

 

PersonEntry (yyyy-mm-dd hh:mm)Exit (yyyy-mm-dd hh:mm)DateTime for Ticket (yyyy-mm-dd hh:mm)Unique Code
a,smith2022-05-04 06:352022-05-04 15:352022-05-04 12:35A12
b,jones2022-05-05 14:442022-05-05 16:132022-05-05 14:44C54
a,smith2022-05-05 12:13 2022-05-05 16:502022-05-05 15:59AA59
b,jones2022-05-05 18:122022-05-05 23:58  
c,charlie2022-05-05 19:212022-05-05 22:132022-05-05 21:21Z65
c,charlie2022-05-05 23:592022-05-06 06:15  
a,smith2022-05-05 23:592022-06-06 12:15 2022-05-06 01:32G56

 

I have tried doing summary's but i come up blank. How is this best solved?

Thank you

Bob

3 REPLIES 3
grazitti_sapna
17 - Castor

Hi @Bobbins , You can accomplish your output by using join tool components. Here is my solution. Please accept it if this is what you were looking for.

 

grazitti_sapna_0-1662625027389.png

 

 

Thanks!!

Sapna Gupta
DataNath
17 - Castor
17 - Castor

Here's how I'd go about this - just need to join, before filtering out those DateTimes that don't fall within the Entry/Exit range. Then we can rejoin those to the original before unioning any records without a match.

 

DataNath_0-1662625438315.png

 

Note: In my filter I've used > and < explicitly, but if you want to include the Entry and Exit times themselves, obviously just use => and <= respectively.

Bobbins
8 - Asteroid

Thank you Both, whilst both are acceptable, i ended up using @DataNath version for my needs.

Labels
Top Solution Authors