> ## Documentation Index
> Fetch the complete documentation index at: https://confidence-auth-testing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate a New Metric

> Learn how to validate a newly created metric using exploratory analysis on a past experiment.

export const HowToSchema = ({name, description, steps = []}) => {
  const schema = {
    "@context": "https://schema.org",
    "@type": "HowTo",
    name,
    description
  };
  if (steps.length > 0) {
    schema.step = steps.map((s, i) => ({
      "@type": "HowToStep",
      position: i + 1,
      name: typeof s === "string" ? s : s.name,
      text: typeof s === "string" ? s : s.text || s.name
    }));
  }
  return <script type="application/ld+json" dangerouslySetInnerHTML={{
    __html: JSON.stringify(schema)
  }} />;
};

<HowToSchema
  name="Validate a New Metric"
  description="Learn how to validate a newly created metric using exploratory analysis on a past experiment."
  steps={[
{
  name: "Select a past experiment",
  text: "Choose an experiment that: - Has already completed and produced results - Uses the same entity as your new metric Navigate to the experiment's page in Confidence.",
},
{
  name: "Create a new exploration",
  text: '1. Go to the Explorations section in the right sidebar 2. Click + to create a new exploration 3. Give it a descriptive name like "Validate [Metric Name]"',
},
{
  name: "Add your new metric",
  text: "1. Click Add metric to open the metric selection dialog 2. Select the checkbox next to your newly created metric 3. Click Add metrics to add it to the exploration 4. Click Calculate to start the analysis You can only select metrics that use the same entity configured for the experiment.",
},
{
  name: "Add dimensions (optional)",
  text: "If you want to validate how your metric behaves across different segments: 1. Click Add dimension next to your metric 2. Select relevant dimensions from dimension tables 3. This helps you verify the metric works correctly across different user segments",
},
{
  name: "Review the results",
  text: "Once the calculation completes, examine the results: - Check the values: Do the metric values look reasonable? - Compare to expectations: If you know the experiment outcome, does your metric show similar patterns? - Review dimensions: Do dimensional breakdowns make sense?",
},
{
  name: "Inspect the SQL",
  text: "If you need to debug the calculation itself, you can inspect the SQL query that was used to calculate the metric. To do this: 1. Find the status indicator showing the query job status 2. Click on the status to view details 3. Review the generated SQL query You can copy the SQL and run it directly in your data warehouse to investigate further if needed.",
},
{
  name: "Document your findings",
  text: "Write a conclusion in the exploration describing: - What you were validating - Whether the metric behaves as expected - Any issues discovered and how you resolved them - Confirmation that the metric is ready for production use This documentation helps others understand the validation process.",
},
]}
/>

After creating a new metric, you should validate it to ensure it's calculating correctly and producing expected results. The best way to validate a metric is to test it against a previous experiment where you already know the outcome.

## Why Validate Metrics?

Validating metrics helps you:

* Confirm the metric calculates as expected
* Verify data joins and aggregations are correct
* Check that the metric responds to known treatment effects
* Inspect the underlying SQL for correctness
* Build confidence before using the metric in production experiments

## Before You Begin

* A completed experiment with known results
* A newly created metric that uses the same entity as the experiment
* Access to create explorations

## Validate Your Metric

<Steps>
  <Step title="Select a past experiment">
    Choose an experiment that:

    * Has already completed and produced results
    * Uses the same entity as your new metric

    Navigate to the experiment's page in Confidence.
  </Step>

  <Step title="Create a new exploration">
    1. Go to the **Explorations** section in the right sidebar
    2. Click **+** to create a new exploration
    3. Give it a descriptive name like "Validate \[Metric Name]"
  </Step>

  <Step title="Add your new metric">
    1. Click **Add metric** to open the metric selection dialog
    2. Select the checkbox next to your newly created metric
    3. Click **Add metrics** to add it to the exploration
    4. Click **Calculate** to start the analysis

    <Note>
      You can only select metrics that use the same entity configured for the experiment.
    </Note>
  </Step>

  <Step title="Add dimensions (optional)">
    If you want to validate how your metric behaves across different segments:

    1. Click **Add dimension** next to your metric
    2. Select relevant dimensions from dimension tables
    3. This helps you verify the metric works correctly across different user segments
  </Step>

  <Step title="Review the results">
    Once the calculation completes, examine the results:

    * **Check the values**: Do the metric values look reasonable?
    * **Compare to expectations**: If you know the experiment outcome, does your metric show similar patterns?
    * **Review dimensions**: Do dimensional breakdowns make sense?
  </Step>

  <Step title="Inspect the SQL">
    If you need to debug the calculation itself, you can inspect the SQL query that was used to calculate the metric. To do this:

    1. Find the status indicator showing the query job status
    2. Click on the status to view details
    3. Review the generated SQL query

    <Tip>
      You can copy the SQL and run it directly in your data warehouse to investigate further if needed.
    </Tip>
  </Step>

  <Step title="Document your findings">
    Write a conclusion in the exploration describing:

    * What you were validating
    * Whether the metric behaves as expected
    * Any issues discovered and how you resolved them
    * Confirmation that the metric is ready for production use

    This documentation helps others understand the validation process.
  </Step>
</Steps>

## Common Validation Checks

When reviewing your metric results, check for:

### Data Volume

* Does the metric produce results?
* Is the sample size similar to other metrics on this experiment?

### Treatment Effect Direction

* If the experiment had a positive effect, does your metric show that?
* Does the magnitude seem reasonable?
* Do confidence intervals make sense?

### Dimensional Consistency

* Do dimension breakdowns align with known patterns?
* Are there any segments with suspiciously different results?

### SQL Validation

* Are aggregations (SUM, AVG, COUNT) applied correctly?
* Are filters applied correctly?

## Related Resources

<CardGroup cols={2}>
  <Card title="Create a Metric" href="/docs/how-to-guides/create-metric">
    Learn how to create metrics in Confidence
  </Card>

  <Card title="Exploration" href="/docs/experiments/exploration">
    Understand how explorations work
  </Card>

  <Card title="Explore Results" href="/docs/how-to-guides/explore-results">
    Detailed guide on using the exploration feature
  </Card>

  <Card title="Metrics Reference" href="/docs/metrics/metrics">
    Technical reference for metrics
  </Card>
</CardGroup>
