In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Numbered rows similar to row-over-partition function in SQL

essemMLB
7 - Meteor

Hello Alteryx community:

 

I'd like to number rows in a method that's similar to the row-over-partition function. I've checked a few of the other threads on this topic and they didn't work quite right, because I think I have an added wrinkle. Here's my dataset:

 

DateHourVisitor_IDVisit_ID
2019-09-019123456789ACBDEF1
2019-09-0111123456789ACBDEF2
2019-09-0120123456789ACBDEF3
2019-09-021123456789ACBDEF4
2019-09-028123456789ACBDEF5

 

Visitor_ID 123456789 comes to my site three times on September 1st and twice on September 2. Each visit has a unique identifier applied to it. What I'd like to do is count each visit based on the day, by ascending hour. The resulting dataset shoud look something like:

 

DateHourVisitor_IDVisit_IDVisit_Num
2019-09-019123456789ABCDEF11
2019-09-0111123456789ABCDEF22
2019-09-0120123456789ABCDEF33
2019-09-021123456789ABCDEF41
2019-09-028123456789ABCDEF52

 

Visit_ID ABCDEF1 is the first visit of Visitor_ID 123456789 on September 1, and then the count resets on the next day, where Visit_ID ABCDEF5 is the first visit of September 2.

 

I would appreciate help with this question!

 

(P.S. Of course, the data does not neatly line up like this. In my dataset, there are hundreds of thousands of Visitor_IDs and Visit_IDs, so it wouldn't be as simple as extracting one Visitor_ID and working individually on them.)

2 REPLIES 2
JessieC
Alteryx
Alteryx

@essemMLB ,

 

You can use the Tile Tool to achieve your desired output - 

clipboard_image_1.png

 

DiganP
Alteryx Alumni (Retired)

@essemMLB I like @JessieC post. As always, there are multiple ways to get the output in Alteryx. I used the Multi-Row Formula tool to create the Visit_Num column.

Dataset.PNG

Digan
Alteryx
Labels
Top Solution Authors