|
||||
|
|
OOTP 19 - General Discussions Everything about the 2018 version of Out of the Park Baseball - officially licensed by MLB.com and the MLBPA. |
|
Thread Tools |
03-17-2018, 10:37 AM | #1 |
Hall Of Famer
|
Create a Power BI dashboard to visualize OOTP stats
Full disclaimer – I only heard about Power BI about a week ago and am definitely not an expert. I’ve found a way to make easy data analysis work but welcome any suggestions for improvement in either analysis or in the transfer process.
Download and install Power BI Go to https://powerbi.microsoft.com and download Power BI Desktop. After installing, you may be prompted to create an account or log in. I was able to close that without doing either and just started with loading data. I believe the account creation is only necessary for the Pro version. Prepare data in OOTP Go to Game -> Game Settings -> Database -> Database Tools -> Configure data export for CSV files. You’ll have to select what data you want to export. For now I’ll just select: Replace accents Insert column names/CSV headings Insert NULL if empty Leagues_basic Players_basic Players_career_batting Players_career_pitching Players_career_fielding Teams_basic Then click Save Go to Database Tools -> Export data to CSV files This will automatically export those tables to your computer Load data into Power BI Click Get Data -> Text/CSV Browse to the Folder path where OOTP exported your files, typically My Documents\Out of the Park Developments\OOTP Baseball 18\saved_games\[League Name]\import_export\csv Select one of the files and click Open. This will show a sample of your data and give you a chance to change data types with the Edit button. I haven’t had to do this as Power BI does a good job of recognizing data types. Click Load. Your data is now loaded into Power BI. Repeat for each of the files you would like to import. These files will be the tables you use in the analysis. Setting relationships Once all the files are loaded in, you will need to check the relationships between the Tables. For instance, if you would like to include a player’s name in a table with their HR totals, you will need to relate the player_id value in the players table with the player_id value in the players_career_batting_stats table. Click on the Relationships tab on the left side of the screen and check that these are all set. In this example, I’ve connected player_id, team_id, and league_id between all six tables. If you need to delete a relationship between tables, just right-click the line between them and select delete. To create a relationship, click and drag the value from one table to the other. Data Analysis and Visualization Go back to the report tab for analysis--the icon with the column chart. Again, I haven’t played with the software very much so I haven’t scratched the surface of what is possible. Let’s say you want to find the top hitters in WAR the last three years in the MLB. You can search in the fields area to find different values. Click and drag the player_id field onto the empty dashboard and it will automatically start creating a table. You may need to click the arrow next to the player_id field and select don’t summarize. Once the visualization exists, dragging more variables from the fields area to them will add them to it. Add first_name and last_name and then search for war and select the value from the players_career_hitting table and drag it onto the same visualization. Click the war heading in the visualization to sort. Those are all the values in the database, now we need to filter by league and year. These steps may change based on your league setup, but the idea is the same. There are different filter types but for now we’ll do it on the whole page. Drag the abbr field to the Page level filters box, change the filter type to Basic filtering, and select MLB. This will filter the data to the MLB level. Now do the same for the year value, dragging this from the players_career_batting_stats table. Choose basic filtering and select the last three years. The difference here is due to rounding, so you actually get more accurate results using the raw data. This is just the tip of the iceberg and the limit is your imagination. You can do actual graphs and even import custom chart designs. Here's a quick example of HR per year. You can create the chart and then select players from the previous table and it will automatically change the chart to show only that player. Another powerful tool is to create a new measure. This is an internal calculation that you can use in visualizations without creating a new column in your table. You can do this for HR/PA, league averages, new stats, etc. Hopefully this will help you get going and I can’t wait to do more of it myself! |
03-17-2018, 10:59 AM | #2 |
Minors (Triple A)
Join Date: Feb 2015
Posts: 213
|
We just got Tableau at work. I may have to spend some of my lunch building visualizations on my seasons.
|
03-17-2018, 11:05 AM | #3 |
All Star Reserve
Join Date: Dec 2003
Location: Seattle, WA
Posts: 865
|
I need to find the time to do this. I've wanted this for so long! Thank you so much for the jumpstart.
|
03-17-2018, 11:37 AM | #4 |
Hall Of Famer
|
|
04-04-2020, 06:14 PM | #5 |
Minors (Rookie Ball)
Join Date: Sep 2014
Posts: 28
|
This is really cool, and exactly the thing I want to build for my save. One question. When you progressed with days and re-exported the CSVs, did you have to completely re-do the relations and data transformation, or were you able to just refresh the model from the latest updated CSV files?
|
04-09-2020, 09:00 AM | #6 | |
Hall Of Famer
|
Quote:
|
|
Bookmarks |
Thread Tools | |
|
|