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

# Create a Fact Table

> Learn how to create a fact table in Confidence.

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="Create a Fact Table"
  description="Learn how to create a fact table in Confidence."
  steps={[
"Go to Confidence",
{
  name: "Select Admin > Fact tables",
  text: "On the left sidebar, select Admin > Fact tables.",
},
{
  name: "Click Create",
  text: "Click + Create to create a new fact table.",
},
{
  name: "Enter a name for the fact table",
  text: "In the About section, enter a name and select an owner.",
},
{
  name: "Enter the SQL query",
  text: "In the Query section, enter the SQL that selects your fact rows and click Run query. See the SQL query section in the reference documentation for SQL query best practices.",
},
{
  name: "Configure the table",
  text: "In the Configure table section, map the timestamp column, entity columns, measurement columns, and dimension columns.",
},
{
  name: "Click Create",
  text: "When you click create, the fact table goes into state CREATING. Confidence then runs a sample query towards the fact table to verify that the SQL query produces columns that match what you've specified. After this the table either goes to state ACTIVE or FAILED.",
},
]}
/>

A [fact table](../metrics/fact-tables) contains measurements that describe your entities.

## Create a Fact Table

<Steps>
  <Step title="Go to Confidence" />

  <Step title="Select Admin > Fact tables">
    On the left sidebar, select **Admin > Fact tables**.
  </Step>

  <Step title="Click Create">
    Click **+ Create** to create a new fact table.
  </Step>

  <Step title="Enter a name for the fact table">
    In the **About** section, enter a name and select an owner.
  </Step>

  <Step title="Enter the SQL query">
    In the **Query** section, enter the SQL that selects your fact rows and click **Run query**. See the [SQL query section](../metrics/fact-tables#sql-query) in the reference documentation for SQL query best practices.
  </Step>

  <Step title="Configure the table">
    In the **Configure table** section, map the timestamp column, entity columns, measurement columns, and dimension columns.
  </Step>

  <Step title="Click Create">
    When you click create, the fact table goes into state `CREATING`. Confidence then runs a sample query towards the fact table to verify that the SQL query produces columns that match what you've specified. After this the table either goes to state `ACTIVE` or `FAILED`.
  </Step>
</Steps>

<Tip>
  To create fact tables via the API, see [Create Fact Tables](../api/how-to-guides/metrics/create-fact-table) in the API how-to guides.
</Tip>

## Related Resources

<CardGroup cols={2}>
  <Card title="Fact Tables Reference" href="/docs/metrics/fact-tables">
    Deep dive into fact table configuration
  </Card>

  <Card title="Create Metrics" href="/docs/how-to-guides/create-metric">
    Build metrics from your fact tables
  </Card>

  <Card title="Create Dimension Tables" href="/docs/how-to-guides/create-dimension-table">
    Add segmentation dimensions
  </Card>
</CardGroup>
