Alteryx Designer Desktop Discussions

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

How to Calculate Streak per Team per Date in a dataset of NBA-schedule ?

Lazzanova
7 - Meteor

Hello everyone!

Many of my friends and I love the NBA and the question we had the other night is whether or not the Lakers will qualify for the play-in or play-offs this season.
So I downloaded the results of every game played this season so far.

The colomns I have are:
- Date  (The date the game was played)
- Start ET (At what time the game was started)
- Visitor/Neutral (The name of the visiting team)
- PTS (Points scored by the visiting team)
- Home/Neutral (The name of the home team)
- PTS2 (Points scored by the home team)

After adding RecordID's the dataset looks like this:

Lazzanova_0-1679569683728.png


Before I started using the Predictive Machine Learning Algorythms, I wanted to enrich the data even further.
I wanted to add Streak Per Team per Date. Telling whether or not a team had a winning streak or a losing streak before the game was played on a date.
Ideally if a team had a winning streak of two games, the colom would say "W2". Losing streak of two would result into "L2" etc.

The hardest part here is that a team is sometimes a visitor and sometimes playing home. 
Two colomns need to be added: VisitorStreak and HomeStreak.
Adding these columns is easy. The formula to calculate the streak isn't.

Is there anyone who could help me out with this?

I've added the txt file containing the results of the games.

With kind regards,

Lazzanova


3 REPLIES 3
FrederikE
13 - Pulsar

Hey @Lazzanova,

 

I have calculated away-win streaks in the attached workflow. You would need to do the same thing again for the home wins. 

 

FrederikE_0-1679571866922.png

 

Christina_H
14 - Magnetar

I think this does what you need

Christina_H_0-1679578471842.png

 

Lazzanova
7 - Meteor

Hey Christina, 

This does what I need indeed! Though I am trying to figure out what you did there with the Tile-tool.

Thank you very much!

Labels