> For the complete documentation index, see [llms.txt](https://docs.infotopics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infotopics.com/trulyp/analytics/data-sources-and-fields.md).

# Data sources and fields

Every chart in Analytics gets its data from a **data source**: a [semantic model](/trulyp/data/semantic-modeling.md) that is connected to the app. You manage data sources on the **Data** tab of the editor.

### Connect a semantic model

<figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2Fgit-blob-0976786f77ca17718d429906fe5a28bb7a10b86b%2FAnalytics_Data_Connected.png?alt=media" alt="The Data tab with one connected model"><figcaption></figcaption></figure>

1. In the editor, open the **Data** tab (or choose **…** > **Data sources**, or click **+ Connect data** in the Fields list).
2. Under **Available models**, click **Connect** next to a model. Use **Search semantic models…** if the list is long.
3. The model moves to **Connected** and its fields appear in the **Fields** list.

For each connected model you can:

* **Use in visual**: when a visual is selected, switch that visual to this data source.
* **Refresh fields**: reload the columns, for example after the semantic model was changed.
* **Disconnect**: remove the model from the app. You can't disconnect a data source that other visuals or calculations still use. Hover over the button to see which ones.

Other buttons on this tab:

* **View model** opens the semantic model in a new tab.
* **Create semantic model** opens the semantic model editor in a new tab. Click the refresh icon at the top of the panel afterwards to see the new model.

{% hint style="info" %}
Which models you see depends on the [teams](/trulyp/settings/members-teams-roles-and-access/teams.md) you are in. Connections are saved with the app, so people you share it with don't need to connect anything.
{% endhint %}

### Fields: dimensions and measures

Each column of a data source becomes a field. Trulyp decides the role of a field from its data type:

| Role            | Data types       | Used for                                                                     | Colour in the Fields list |
| --------------- | ---------------- | ---------------------------------------------------------------------------- | ------------------------- |
| **Dimension**   | Text and dates   | Grouping and filtering: categories, labels, X axes, slices, filter values.   | Green                     |
| **Measure**     | Numbers          | Values that are aggregated, for example with SUM or AVG.                     | Blue                      |
| **Calculation** | Your own formula | Treated as a measure. See [Calculations](/trulyp/analytics/calculations.md). | Purple                    |

A column that is numeric in the database but should be treated as text, such as a postal code or customer number, can be changed to **Text** in the semantic model. See [Semantic modeling](/trulyp/data/semantic-modeling.md).

Each chart uses the fields of **one** data source. You can connect several sources to an app and use a different one in every chart.

### Aggregations and date grouping

When you add a measure to a visual, you can choose how it is aggregated:

| Aggregation       | Result                         |
| ----------------- | ------------------------------ |
| **SUM**           | The total (default).           |
| **AVG**           | The average.                   |
| **MIN** / **MAX** | The lowest or highest value.   |
| **COUNT**         | The number of rows.            |
| **COUNTD**        | The number of distinct values. |

When you add a date field, you choose how dates are grouped. A new date field is grouped by **Year**.

* **None**: every exact date separately.
* **Discrete**: Year, Quarter, Month, Week or Day as a recurring period. For example, **Month** combines every January across all years.
* **Continuous**: Year, Quarter, Month, Week or Day on a timeline. For example, **Month** shows January 2025, February 2025 and so on.

Bar, line and area charts fill in missing periods on a continuous date axis, so gaps in your data are visible.

### Import an Excel or CSV file

{% hint style="info" %}
File import is a recent addition. If you don't see the **Import Excel or CSV** button, your Trulyp environment doesn't have this version yet.
{% endhint %}

Don't have a semantic model for your data yet? You can import a CSV or Excel file straight from the **Data** tab. Trulyp stores the data in a WriteBackExtreme schema, creates a semantic model for it, and connects that model to your app in one go.

Importing a file requires both the **Schema Manager** and **Semantic Manager** roles. You also need access to at least one connection that Trulyp can write to.

1. On the **Data** tab, click **Import Excel or CSV** (or the upload icon at the top).

   <figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2Fgit-blob-6bbfa9d900277e636b9cbe79f199a97e3cfddffd%2FAnalytics_Create_Import_File_Panel.png?alt=media" alt="The Import Excel or CSV button at the bottom of the Data tab" width="320"><figcaption></figcaption></figure>
2. Drop a CSV or Excel file (.xlsx, .xls, .xlsm or .xlsb) onto the dialog, or click to choose one. For Excel workbooks, the first worksheet is used. For CSV files, the separator (comma, semicolon, tab or pipe) is detected automatically.

   <figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2Fgit-blob-3e27f870d48566519989348d0837d476a6d3eb8d%2FAnalytics_Create_Import_File_Dialog.png?alt=media" alt="The Import a file as data dialog"><figcaption></figcaption></figure>
3. Review the import before anything is stored:
   * **Datasource name**: the name of the new data source, at least three characters.
   * **Writeback connection**: the database where the data is stored.
   * **First row contains column names**: untick this if your file has no header row.
   * **Columns**: names and data types (**Text**, **Integer**, **Decimal**, **Boolean**, **Date** or **Date & time**) are detected from your file. Rename columns, change their type, or untick columns you don't want to import.
   * **Preview**: the first rows as they will be imported.
4. Click **Create and import**. Trulyp shows the progress while it creates the schema and the columns, uploads the rows in batches, and creates the semantic model.
5. When **Data source ready** appears, click **Done**. The fields from your file are now available in your app.

The imported data appears as a regular schema under WriteBackExtreme, with **Analytics** as its source, and as a semantic model under **Data**.

### Limits and performance

* A visual loads at most **250,000 rows**. When a visual reaches this limit, a warning icon appears in its toolbar. Add filters or a **Row limit** to narrow the data.
* Data is loaded in pages of 5,000 rows, so large visuals fill up progressively.
* Visuals only query the database again when their data changes (fields, aggregation, filters, sorting or row limit), not when you change formatting.
* Use **…** > **Refresh data** to reload the visuals on the current page.


---

# 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.infotopics.com/trulyp/analytics/data-sources-and-fields.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.
