118|ALTERYX – Lebron’s Early Dominance

BYU Student Author: @DylanKing
Reviewers: @Marco, @Boston
Estimated Time to Solve: 60 Minutes

We provide the solution to this challenge using:

Need a program? Click here.

You’ve been working in public accounting for years now and you have decided you have had enough. Somehow, someway, you have a connection with ESPN and are taking a once-in-a-lifetime opportunity as Stephen A. Smith’s co-host for the hit sports show, First Take. As a huge basketball fan, you want to prepare for your first day on the show when you will debate Lebron’s legacy. Using your data analytics background, you want to find and create stats to outsmart Stephen A.


  1. You want to focus all of your stats on LeBron James’ first stint with Cleveland which was from 2003-2010. The NBA has five major key stats: points, assists, rebounds, steals, and blocks. You want to create a new metric that displays Lebron’s overall dominance. Add up these five key stats to create a new column called Key Stats. Group by player and find what each player’s average was for this metric through the stated time period. Your output should have two columns: Player and Key Stats Avg. Sort by Key Stats Avg in descending order and round Key Stats Avg to two decimal places.
  2. Next, you want to show Lebron’s consistent dominance at such a young age. Rather than looking at averages you want to look at totals for these key stats. For example, if you were to try and find the total points a player scored in a season, you would multiply the number of games they played by their average points per game. Once you calculate the totals for the key stats for each season and player, then calculate the total for each player during this time period. Create a ranking of players for each key stat. Additionally, calculate the total MVPS for each player during this time period and create a ranking of players based on how many MVPs they won. After compiling all of this information, create an output that shows Lebron’s name with all of his totals and rankings across these six categories: points, assists, rebounds, steals, blocks, and MVPs.
  3. Lastly, you want to emphasize that although Lebron lacked quality help, he was able to have consistent team success. Calculate each team’s average winning percentage from 2003-2010 (consistent with the time period we have been using). Round the average winning percentage to three decimal places and rank the teams in order from highest winning percentage to lowest winning percentage. Your output should have three columns: Average Winning Percentage Rank, Team, and Average Winning Percentage. Only show Lebron’s team which was the Cavaliers (your output should only have one row).

Data Files

Suggestions and Hints
  • Be sure to spend time understanding the data you were given by going through the data dictionary.
  • I used transpose tools and a union to compile all the totals and rankings into one table for number two.


Dylan the King! Thanks for this challenge, very fun for a basketball fan like me! Not gonna lie, LeBron is pretty great… I don’t know if he is the GOAT though. I didn’t transpose the rows into column like you did. But this is a good practice for Alteryx!

1 Like