Targets
Targets define performance goals in Dolfin's compensation system. They are tied to metrics and used to calculate achievement rates that drive bonuses, multipliers, and other compensation logic.
🎯 What Are Targets?
Targets define expected performance levels for a given metric within a time period. They are used to determine how much of a goal has been achieved and directly influence payout logic in compensation rules.
Targets are always evaluated as a ratio between 0 and 1. This value—called achievement—is used to:
- Calculate bonuses proportionally
- Determine commission tiers
- Apply multipliers
- Drive conditional logic
📌 Where Targets Are Used
| Use Case | Description |
|---|---|
| Bonus Nodes | Used in proportional and tiered payout calculations. |
| Multiplier Nodes | Used to apply scaling factors to previously calculated compensation. |
| Commission Nodes | Used to gate commission tiers. |
| Conditional Logic | Can be used to define filter logic for rule branches. |
| Compensation Statements | Achievement is surfaced to users to show progress. |
🔍 Target Structure
| Field | Description |
|---|---|
| metric_id | The metric this target is tied to. |
| target_amount | The numeric goal to be hit. |
| period_start / period_end | The time range the target applies to. |
| team_target | If true, this is a team-based target. |
| global_target | If true, the same target applies to all users. |
| is_upper_bound | If true, lower values are considered better. |
| allow_partial_outcome | Only relevant for manually-entered targets. If false, achievement is binary (1 if achieved, 0 if not). |
| team_ids | Teams the target applies to (if applicable). |
🧠 Achievement Calculation
Achievement is always returned as a ratio between 0 and 1, unless is_upper_bound = true, in which case it may exceed 1.
- Standard Targets: achievement = metric_value / target_amount
- Upper Bound Targets: achievement = target_amount / metric_value
Manual Targets
If the target is manually entered (not derived from a metric), allow_partial_outcome modifies how achievement is calculated:
-
If
allow_partial_outcome = false, achievement is either:1(goal met)0(goal missed)
-
If
allow_partial_outcome = true, partial achievement is allowed (e.g. 0.7).
⚙️ Target Evaluation Logic
Target evaluation is performed by comparing actual performance (metric value) with the defined target amount. Here's how it works:
- Determine the applicable target
- Identify the user’s teams.
- Check if the target is global, team-based, or individual.
- Select the most relevant entry (profile → team → global), using the correct aggregation function.
- Calculate the metric value
- Evaluate the metric over the given period and user/team scope.
- Compare against the target amount
- If
is_upper_bound = false: dividemetric_value / target_amount. - If
is_upper_bound = true: dividetarget_amount / metric_value.
- Adjust for manual overrides
- If the target is manually entered:
- With
allow_partial_outcome = false: result is1if the target is met,0otherwise. - With
allow_partial_outcome = true: result is proportional.
- Return the result
- The final value is a ratio representing achievement:
0.0= nothing achieved,1.0= target met,>1.0= overachieved (in some cases).
🧩 Example Usage in a Bonus Node
This rule grants a proportional bonus if the user achieves between 50% and 100% of the target.