> ## Documentation Index
> Fetch the complete documentation index at: https://help-empuls.xoxoday.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating and implementing plans and metrics

> Turn a connection into a metric, then wrap that metric in a milestone plan with rewards — end-to-end in Compass.

<iframe width="100%" height="450" src="https://www.youtube.com/embed/ciHxs7u9AsE?rel=0" frameborder="0" allowfullscreen allow="autoplay; fullscreen; picture-in-picture; encrypted-media" title="Xoxoday Compass — Plans and Metrics" style={{borderRadius: '12px', border: 'none', display: 'block'}} />

Building on the connection created for Carol in the previous video, this walkthrough shows how to author a metric and use it in a milestone plan to compute rewards.

## Create a metric

<Steps>
  <Step title="Open the metric library">
    Go to **Metrics** and click **Create a metric**. A metric is the logic applied on a connection to compute a value.
  </Step>

  <Step title="Pick the metric type">
    Compass supports three types:

    * **Aggregate metric** — sums, averages, counts on a connection
    * **Linear metric** — formula-based
    * **Mapping variable** — value lookups
  </Step>

  <Step title="Configure the metric">
    Give the metric a name (for example, `Test metric 1`), select an aggregate type such as **Sum**, and choose the connection (for example, `Additive data`). Compass then lists the fields available in that connection.
  </Step>

  <Step title="Add functions and operators">
    Use built-in functions to shape the calculation — logical (`if / then / else`), mathematical, and operators such as `greater than`, `not equal to`, `between`, `null`, `not null`. You can also add mappings.
  </Step>

  <Step title="Sum the target field and save">
    For this example, apply **Sum** to the `monthly` field and click **Save**. The metric is now a reusable slice of logic available to any plan.
  </Step>
</Steps>

## Create a milestone plan

<Steps>
  <Step title="Open Plans and start a new plan">
    Go to **Plans**, open a plan group, and click **Create plan**. Compass offers three plan types — for this example, choose **Milestone plan**. A milestone plan awards rewards when users hit thresholds defined by one or more KPIs.
  </Step>

  <Step title="Name the plan">
    Enter a plan name (for example, `Test plan 001`) and click **Next**.
  </Step>

  <Step title="Define the milestone condition">
    Add a milestone condition using the metric you just created — for example, `Test metric 1 > 0`. Every user whose value satisfies this condition is added to the plan as an active participant.
  </Step>

  <Step title="Configure the reward">
    Add a reward. Rewards can be a fixed amount or a dynamic expression built from your metrics. For this example, give a **Score** equal to `Test metric 1 × 0.5` — half of the summed monthly value. Save and click **Next**.
  </Step>

  <Step title="Set dates and description">
    Select the campaign period (for example, January) and add a short plan description. Complete the remaining steps and **Activate** the plan.
  </Step>

  <Step title="View the plan dashboard">
    Click **View dashboard** to see the plan report — first name, partner code, `Test metric 1`, and the computed score. Sort the report to inspect individual users (like Carol) and see the sum, the reward, and the final earnings.
  </Step>
</Steps>

## How it fits together

User data joins to a transaction table through a **connection**. A **metric** is the logic applied on that connection. A **plan** uses the metric as an input — a milestone condition determines who qualifies, and a reward expression determines what they earn.
