> For the complete documentation index, see [llms.txt](https://docs.onelens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onelens.cloud/observe-visibility-and-insights/unit-economics/datasets.md).

# Datasets

Datasets are the building blocks of every allocation rule. They hold the business data OneLens needs to share cost out: who or what receives cost, how your business maps to cloud resources, and the usage numbers that decide each share.

Go to **Observe → Unit Economics → Datasets**.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2F4paIfzSLMD2GfGuFmGDS%2Fimage.png?alt=media&amp;token=1a4a64ec-ca6d-4e9d-831f-d1514f21b4f2" alt=""><figcaption></figcaption></figure>

### Dataset types

Click **Add** to create one of three types.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FUCqjiG4DpV0S0VyTDKwd%2Fimage.png?alt=media&amp;token=a82d4d31-7dd6-4604-9a0d-38225b94e4c8" alt=""><figcaption></figcaption></figure>

| Type    | What it is                                                                                                                                                                                                                                      | Example                                       |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| Entity  | A list of records, such as customers, products or business units. An entity is either a **Cost Target**, which receives allocated cost and becomes the rows of your report, or a **Cost Source**, which is a dimension used in allocation rules | Your customer list                            |
| Mapping | Defines how two sets of records relate                                                                                                                                                                                                          | Which cloud accounts belong to which customer |
| Metric  | A numeric time series keyed by an entity, a cost center or a virtual tag                                                                                                                                                                        | Database size per customer per month          |

### The datasets list

| Column                                  | What it shows                                                                                      |
| --------------------------------------- | -------------------------------------------------------------------------------------------------- |
| Dataset Name                            | The dataset's name                                                                                 |
| Type                                    | Metric, Mapping, or Entity with its role, such as Entity Target                                    |
| Granularity                             | How often data is expected, such as Monthly                                                        |
| Input                                   | **Manual** if people enter the data in OneLens, or Automated if it arrives by API or from a system |
| Records                                 | Number of records in the dataset                                                                   |
| Owner                                   | Who is responsible for the data                                                                    |
| Health                                  | Whether data has arrived on time. **Stale** means no data arrived by the expected date             |
| Created By, Updated By, Last Updated At | Who created and last changed the dataset, and when                                                 |
| Actions                                 | Edit the dataset, or open more options                                                             |

### Add an entity

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FzcLLrHJu2GIovM651pfD%2Fimage.png?alt=media&amp;token=9c3efbf4-72dc-4090-93a3-474ff2139560" alt=""><figcaption></figcaption></figure>

1. Click **Add → Entity**.
2. Enter an **Entity Name**. OneLens fills in the **Entity ID** from it.
3. Choose a **Role**:
   * **Cost Target** if this entity should receive allocated cost and appear as rows in the report, such as customers.
   * **Cost Source** if it is a dimension used in allocation rules.
4. Pick an **Owner** and add a **Description**.
5. Under **Data Setup**, choose the **Data Granularity** and the **Input Method**: **Manual (UI input)** or **Automated (API/System)**.
6. For automated data, set **Expect data by**. If no data arrives by that day, OneLens marks the dataset as stale. For example, with Monthly and the 5th, the dataset is flagged stale if no data is detected by the 5th of the month.

### Add a mapping

A mapping links records on one side to records on the other. The "from" side can be a **Cost360 Dimension**, such as cloud account, or one of your entities. The "to" side is usually one of your entities. For example, you can map cloud accounts to customers.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FPb4Vnbjs9C3hqpU2lqAA%2Fimage.png?alt=media&amp;token=e4f11dd8-ac7b-44c0-b21c-9e8bd2978176" alt=""><figcaption></figcaption></figure>

1. Click **Add → Mapping**.
2. Enter a **Mapping Name** and choose the **Cardinality**, such as Many:Many.
3. Choose the **From Entity Type** and **From Entity**, then the **To Entity Type** and **To Entity**.
4. Pick an **Owner**.
5. Under **Data Setup**, choose the **Data Granularity** and **Input Method**.
6. For manual input, set up the **monthly data reminder**. Choose who to email and on which day of the month. OneLens sends the reminder only if no data has been submitted by then.

Manual values show as editable cells in the output report, and OneLens keeps a version history of each entry.

### Add a metric

A metric needs at least one numeric field. OneLens adds that numeric field for you, and it cannot be removed.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2F1zekiGc1Lnw9zFNeZV59%2Fimage.png?alt=media&amp;token=c99ccf54-cca3-4b77-83d0-50deeac48d0e" alt=""><figcaption></figcaption></figure>

In step 2, **Set-up metric fields**, define each field:

| Setting    | What it does                                                                          |
| ---------- | ------------------------------------------------------------------------------------- |
| Data Field | The field name in your data                                                           |
| Field Type | What the field holds: an entity key (such as a customer), a Number, or the Usage Date |
| Rename As  | The name to show in reports                                                           |
| Unit       | The unit for numbers, such as GB                                                      |
| Required?  | Whether every record must have a value                                                |

Click **Download Template** to get a file with these fields, so you can upload initial records.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.onelens.cloud/observe-visibility-and-insights/unit-economics/datasets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
