Home | Webstore
Latest News: OOTP 25 Available - FHM 10 Available - OOTP Go! Available

Out of the Park Baseball 25 Buy Now!

  

Go Back   OOTP Developments Forums > Prior Versions of Our Games > Out of the Park Baseball 19 > OOTP 19 - General Discussions

OOTP 19 - General Discussions Everything about the 2018 version of Out of the Park Baseball - officially licensed by MLB.com and the MLBPA.

Reply
 
Thread Tools
Old 03-17-2018, 10:37 AM   #1
stealofhome
Hall Of Famer
 
stealofhome's Avatar
 
Join Date: Apr 2014
Posts: 2,282
Blog Entries: 1
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!
stealofhome is offline   Reply With Quote
Old 03-17-2018, 10:59 AM   #2
TwinsGuy11
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.
TwinsGuy11 is offline   Reply With Quote
Old 03-17-2018, 11:05 AM   #3
mars001
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.
mars001 is offline   Reply With Quote
Old 03-17-2018, 11:37 AM   #4
stealofhome
Hall Of Famer
 
stealofhome's Avatar
 
Join Date: Apr 2014
Posts: 2,282
Blog Entries: 1
Quote:
Originally Posted by TwinsGuy11 View Post
We just got Tableau at work. I may have to spend some of my lunch building visualizations on my seasons.
Nice, I have used tableau in the past but remember that there were limitations on saving the visualizations. I'm sure you can do the same stuff there.
stealofhome is offline   Reply With Quote
Old 04-04-2020, 06:14 PM   #5
BigCountryBumgarner
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?
BigCountryBumgarner is offline   Reply With Quote
Old 04-09-2020, 09:00 AM   #6
stealofhome
Hall Of Famer
 
stealofhome's Avatar
 
Join Date: Apr 2014
Posts: 2,282
Blog Entries: 1
Quote:
Originally Posted by BigCountryBumgarner View Post
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?
This was actually the beginning of my journey to R instead of Power BI or Tableau. What I wanted to do required DAX programming anyway so I figured, why not learn a programming language instead?
stealofhome is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:59 AM.

 

Major League and Minor League Baseball trademarks and copyrights are used with permission of Major League Baseball. Visit MLB.com and MiLB.com.

Officially Licensed Product – MLB Players, Inc.

Out of the Park Baseball is a registered trademark of Out of the Park Developments GmbH & Co. KG

Google Play is a trademark of Google Inc.

Apple, iPhone, iPod touch and iPad are trademarks of Apple Inc., registered in the U.S. and other countries.

COPYRIGHT © 2023 OUT OF THE PARK DEVELOPMENTS. ALL RIGHTS RESERVED.

 

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright © 2020 Out of the Park Developments