Free Trial

Alteryx Designer Desktop Discussions

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

Fantasy Baseball Analytics

Bearcatrunner
5 - Atom

I’m using my Fantasy Baseball league to learn more about analytics. I have an Excel file with the following columns:

  • Player
  • Age
  • Salary
  • Contract_Length
  • FPts (Projected Fantasy Points for the upcoming season)

I want to figure out a way to rank and score each player.

The challenge is that the contract length plays a big role in how valuable a player is. For example, if a player is relatively cheap (say, 300k), productive, and 23 years old with a 5-year contract, that’s a good situation. On the other hand, a player who is 34 years old, making 70 million, and has a 10-year contract isn’t as favorable, since you'd have to honor that contract for a longer period.

Do you have any suggestions for how to approach this in Alteryx? I’m comfortable with data cleaning, maintaining, and breaking things down, but analyzing scenarios like this is an area I need more help with.

Thanks in advance!

2 REPLIES 2
The_Rad_Valentina
8 - Asteroid
8 - Asteroid

Below are some high-level ideas and workflows to consider. They aren’t specific “click by click” instructions, but rather ways you could structure your analysis in Alteryx (or any tool, really) to capture the trade-offs between age, salary, contract length, and projected fantasy points.

1) Define the Core Question or Objective

Before you build any analytic framework, clarify what “value” really means for your league context:

  • Do you want maximum fantasy points per dollar spent?
  • Do you care about total fantasy points over the entire contract (i.e., the long-term benefit)?
  • How much do you weigh the downside risk of a large, aging player with a long contract?
  • Do you want the flexibility to drop players and re-allocate money?

Once that’s clear, you can pick or build a formula that best represents that objective.

2) Combine Your Metrics into a “Value Score”

A common approach is to create a composite score (or multiple scores) using the available data. For example:

  1. Annual Cost = Salary / Contract_Length
  2. Total Contract Cost = Salary * Contract_Length
  3. Projected Points (annual) = FPts
  4. Projected Points Over Contract = FPts * Contract_Length

You can then combine these into a single ratio or weighted measure that balances cost, production, and risk.

Example (simple ratio idea):

Value Score=Projected Annual FPtsAnnual Cost×1Age Factor\text{Value Score} = \frac{\text{Projected Annual FPts}}{\text{Annual Cost}} \times \frac{1}{\text{Age Factor}}

Where “Age Factor” might be something like (1+0.01×(Age−25))(1 + 0.01 \times (\text{Age} - 25)) to slightly penalize older players.

That’s a very rough example; you might get more nuanced by adding contract length in ways that amplify or penalize long-term deals.

3) Account for Aging and Contracts Over Time

In baseball (and fantasy baseball), performance often declines (or at least gets riskier) with age, and long contracts for older players can be detrimental. If you want to reflect that:

  1. Use an Age Curve: Assign an annual performance degradation factor for each year of age above some threshold (e.g., 30 years old).
  2. Apply a Discount Rate: This is similar to Net Present Value (NPV) in finance. Money (and points) in future years might be “less valuable” than in the current year, especially if risk is higher.

You can create something like a “NPV of Total Points” relative to “NPV of Contract Cost.” For instance, if you have a discount rate rr, the value in year tt is discounted by 1(1+r)t\frac{1}{(1 + r)^t}.

This requires some assumptions, but can provide a better “apples to apples” comparison of multi-year deals.

4) Putting It All Together in Alteryx

Let’s assume you have a dataset with columns:

  • Player
  • Age
  • Salary (annual)
  • Contract_Length
  • FPts (Projected for next season)

a) Building the Workflow

  1. Input Data: Start with your Excel file in Alteryx via the Input Data tool.

  2. Create Formulas: Use the Formula tool to create new fields:

    • Annual_Cost = [Salary] / [Contract_Length] (if Salary was total over length, or you might skip if Salary is already annual).
    • Total_Cost = [Salary] * [Contract_Length] (if Salary is annual, multiply by years).
    • Projected_Total_FPts = [FPts] * [Contract_Length].
    • Age_Penalty or something similar, e.g. IF Age > 30 THEN 1 + 0.02*(Age - 30) ELSE 1 ENDIF (this is a made-up formula for illustration).
  3. Compute a Composite Value Score: In a new Formula tool, combine the above into your chosen metric. For instance:

    [Value_Score] = 
        ([Projected_Total_FPts] / [Total_Cost]) 
        / [Age_Penalty]

    or use any ratio/weighted combination that aligns with your league’s needs.

  4. Ranking: Use the Sort tool to sort by [Value_Score] descending, or you can use a Rank tool (part of the Transform or Summarize options, or a multi-row formula) to assign a numeric rank to each player.

b) Scenario Analysis

If you want to try different weighting scenarios (e.g., more emphasis on age or more emphasis on cost), you can:

  • Create multiple “Value Score” fields with different weights in a single pass (e.g., [Value_Score_Scenario1], [Value_Score_Scenario2], etc.).
  • Compare the ranks across scenarios in a summary table or interactive dashboard (e.g., using the Reporting tools or sending the output to Power BI/Tableau).

c) Consider Predictive Tools (Optional)

Alteryx has built-in predictive tools (Linear Regression, Random Forest, etc.) if you want to get more sophisticated. For instance:

  1. You could attempt to predict future Fantasy Points as a function of Age, Salary, historical performance, etc.
  2. Then use that predicted performance in your Value Score instead of a single FPts projection.

However, that typically requires more historical data on players, performance, injuries, etc.

5) Practical Tips

  1. Don’t Overcomplicate: Start with a simple ratio—e.g., projected points / cost. Add factors (age, contract length) only as they meaningfully improve the ranking for your league context.
  2. Re-Validate Assumptions: If your league values immediate, big hits over steady multi-year production, that changes the weighting. If you can trade players easily, long contracts might not be as big a burden.
  3. Iterate: Build a simple formula, see how the ranks look, then adjust weightings. Often you’ll find a formula that “feels” about right to your personal strategy.
  4. Document: In Alteryx, annotate your workflow so you remember how each calculation or weighting was determined. This helps in future seasons.

Example Formula in Action

Here’s a made-up example just to illustrate how you might put it into a single expression:

Value_Score = 
   ([FPts] * [Contract_Length] * (1 - 0.01 * (Age - 25))) 
   / ([Salary] * [Contract_Length])
  • (1 - 0.01 * (Age - 25)): A factor that reduces total points for each year above 25 by 1%. (You could adjust the slope, the baseline age, etc.)
  • This yields higher scores for younger players with good point projections and relatively low salaries.

From there, refine your approach as you gather insights. Good luck with your fantasy league analytics!

Bearcatrunner
5 - Atom

First off wow and thanks for responding but also for putting so much work and detail in it.  I'm going to read it and the reread it and then try to understand everything you wrote.  Before diving into deep I just wanted to make sure I thanked you for this.  So THANK-YOU!  I have many strengths but this is my one area of weakness.  

Labels
Top Solution Authors