> For the complete documentation index, see [llms.txt](https://docs.reorc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reorc.com/semantic-modeling/view/primary-dimension.md).

# Primary Dimension

## Overview

The **Primary Dimension** in ReOrc Views serves as the key identifier that defines the root Cube for the join path. It establishes a structured relationship for combining multiple data sources, ensuring accurate and efficient data retrieval.

### Purpose of the Primary Dimension

* **Defines the Root Cube**: Determines the starting point for joining multiple Cubes within the View.
* **Ensures Consistent Data Relationships**: Helps maintain a structured and logical data flow by guiding how joins are applied across related datasets.
* **Optimizes Query Performance**: Provides a predefined path for data aggregation, reducing unnecessary joins and improving efficiency.
* **Supports Business Logic**: Ensures that the View aligns with reporting needs by structuring data based on the most relevant business entity.

### Impact of Primary Dimension on Query Results

The choice of Primary Dimension can significantly influence the outcome of queries and reports. Below are examples of how it affects results:

#### **Example 1: Customer-Centric vs. Order-Centric View**

* **Primary Dimension: `Customer ID`**
  * The View will group data around customers.
  * Aggregations such as total spend per customer will be calculated at the customer level.
  * A customer with multiple orders will have their data merged, displaying cumulative totals.
  * Order without customers will not be show in this scenario.
* **Primary Dimension: `Order ID`**
  * The View will group data by individual orders.
  * Each order will be treated as a separate record, displaying order-level details.
  * Orders without customer will be available.

#### **Example 2: Sales Data with Different Primary Dimensions**

* **Primary Dimension: `Product ID`**
  * The View will show total sales grouped by product.
  * Metrics like average revenue per product will be straightforward to compute.
* **Primary Dimension: `Region ID`**
  * The View will aggregate sales data based on geographical regions.
  * Queries will focus on regional trends rather than product-level sales.

## Set Primary Dimension

To set primary dimension for a view, mouse over to the dimension that you would like to set as the primary dimension and click on **...**, select **Set as primary dimension**

<figure><img src="/files/SDf7zn3KXdB0IuMudkRg" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.reorc.com/semantic-modeling/view/primary-dimension.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
