# View

## Overview

A **View** in Recurve is a virtual representation of structured data that enables flexible and efficient data access without duplicating or modifying the underlying source. Unlike Cubes, which focus on organizing raw data into measures and dimensions, Views serve as a refined analytical layer where multiple data sources can be combined, enriched, and optimized for reporting and analysis.

Views are essential for:

* **Aggregating and Reshaping Data**: Views enable dynamic structuring of data across multiple Cubes to align with specific business needs.
* **Combining Data Across Domains**: Views allow users to integrate data from different projects and subject areas into a unified analytical dataset.
* **Enhancing Data Usability**: By defining custom-calculated metrics and pre-applied transformations, Views simplify complex queries and improve accessibility for business users.

## View Concept

A View in Recurve operates as an abstraction layer that sits on top of Cubes and Relationships, refining data structure while maintaining flexibility. The core components of a View include:

#### **1. Cube Integration**

Views draw data from one or more Cubes, utilizing their defined dimensions, measures, and relationships. Rather than modifying raw data, Views structure and optimize it for analytical consumption.

#### **2. Relationship Mapping**

Views leverage predefined Relationships between Cubes, ensuring that data joins are optimized and queries run efficiently. This allows users to analyze data across multiple domains without manual SQL joins.

#### **3. Cross-Project Connectivity**

Unlike Cubes, Views can pull in data from other projects within Recurve, enabling broader data integration and cross-functional reporting.

#### **4.Shared fields (dimensions & measures)**

One of the key differentiators of Views is the ability to define **Calculated Dimensions & Measures** that are not inherently present in Cubes. These include:

* Derived business KPIs (e.g., Customer Retention Rate, Net Profit Margin)
* Custom aggregations (e.g., Rolling 12-Month Sales)
* Advanced filtering logic to segment data dynamically

### Linking Components Together

The strength of Views lies in how they connect multiple semantic components:

* **Cubes serve as foundational data structures** containing key business metrics and dimensions.
* **Relationships define how different Cubes interact**, ensuring data consistency.
* **Views act as an analytical layer**, refining and restructuring Cube data to fit business needs & requirements.
* **Calculated Metrics enhance Views**, enabling users to derive deeper insights without modifying base datasets.

By leveraging Views, users can efficiently model complex business logic, integrate disparate data sources, and create highly optimized datasets for analysis, ensuring a seamless analytical experience.

## Create a View

To create a view, follow these steps:

1. In the **Cube** tab, click on the **+** icon and select **New View**.
2. In the opened modal,&#x20;
   1. Enter the view name
   2. Select the Dimensions & Measures that you would like to create as View.
   3. Click on **Create** button

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

3. View created successfully under View folder.

## Create a View (Reference cube from other projects)

{% hint style="info" %}
Recurve only support reference to other project's cubes that are created under the same connection, refer to [1. Set up a connection](/getting-started/1.-set-up-a-connection.md)
{% endhint %}

Follow these steps to create a view which referencing other project's dimensions & measures:

1. Ensure the other project that you would like to refer has been connected in **Dependencies**. Refer to [Packages and dependencies](/asset-management/packages-and-dependencies.md#manage-dependencies)

2. In the **Cube** tab, click on the **+** icon and select **New View**.

3. In the opened modal,&#x20;

   1. Enter the view name
   2. Select the Dimensions & Measures that you would like to create as View. You can also select dimensions & measures from other project in the list.
   3. Click on **Create** button

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

4. View created successfully under View folder.

5. Click on Edit Relationship and define the relationship with reference cube from other project. Refer [Relationship](/semantic-modeling/cube/relationship.md#define-relationships)

## Update View

If you would like to Add/Remove the dimensions and measures of the existing view, follow these steps:

1. Click on ![](/files/1aWhllvhxErsSipyqHP1)at the **Fields** pane of the existing view.
2. Select/Deselect the dimensions & measures in the opened modal and click on **Update** button.

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

## Preview View Result

In the **Display** pane, you can select the dimensions & measures that you would like to preview **view** by clicking on  **+ Add** under the **Fields** section.

You can further filter the data by adding in the dimensions or measures into the **Filter** section and sort by selected field under **Sort** Section.

Click on **Preview** button to preview the result of the selected fields & criteria.

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

Corresponding to the preview result on the selected fields & conditions, the SQL will be generated on the **Generated SQL** tab.

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

## Organize Views

You can organize the Views into folders that reflect the analysis area and help maintain a clean project structure.

To create a new folder, click on the action button of an existing folder and select **Add sub-folder**:

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

To move a model into the new folder, click on the action button of the model and select **Move to**. Then select the target folder from the list.

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


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
