# Analytics Class

> Analytics class in the TX Sheet Control .NET API: Workbook-wide deterministic data/semantic layer. Query results and profiles are detached values.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Inherits:** `TXTextControl.TXSheetControl.Server.DocumentObject`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > Analytics Class
- **1241 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/llms-full.txt

---

Workbook-wide deterministic data/semantic layer. Query results and profiles are detached values.

### Syntax

```csharp
public class Analytics
```

### Members

#### Methods

| Method | Description |
|---|---|
| [DataAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/dataasync-method/llms-full.txt) | Returns at most 1,000 filtered source rows for an application-authorized inspection workflow. |
| [ProfileAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/profileasync-method/llms-full.txt) | Profiles up to 250,000 cells per source; mixed or identifier fields receive diagnostics. |
| [QueryAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/queryasync-method/llms-full.txt) | Executes a bounded, cooperatively scheduled aggregation independently of the editor UI. |
| [RefreshAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/refreshasync-method/llms-full.txt) | Refreshes source columns/aggregates and raises DataRefreshRequested for host-scheduled live queries. |
| [RelationshipsAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/relationshipsasync-method/llms-full.txt) | Lists explicitly configured many-to-one joins; suggestions are never silently applied. |
| [RemoveRelationshipAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/removerelationshipasync-method/llms-full.txt) | Deletes a relationship by stable ID. |
| [RemoveSourceAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/removesourceasync-method/llms-full.txt) | Removes an explicit binding. Dependent widgets report missing-source errors. |
| [SetDataAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/setdataasync-method/llms-full.txt) | Atomically replaces a connector's transient data; rows are detached and never persisted to TXWB. At most 256 fields / 250,000 cells; values are strings, finite numbers, booleans or null. |
| [SetRelationshipAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/setrelationshipasync-method/llms-full.txt) | Validates unique lookup keys before creating or replacing a relationship. |
| [SetSourceAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/setsourceasync-method/llms-full.txt) | Adds or explicitly replaces a validated source binding. |
| [SourcesAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/sourcesasync-method/llms-full.txt) | Discovers worksheet bindings and explicitly registered logical connector queries. |
| [SuggestRelationshipsAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/suggestrelationshipsasync-method/llms-full.txt) | Suggests reviewed joins only with matching key names/types, unique targets and at least 90% coverage. |

### Examples

Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateAnalyticsReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Range("A1:B5").SetValuesAsync(new object?[][]
    {
        ["Region", "Revenue"], ["North", 42000], ["South", 38500], ["East", 31200], ["West", 44900]
    });

    await book.Analytics.SetSourceAsync(new AnalyticsSource { Id = "sales", Name = "Regional sales", SheetId = sheet.Id, Range = "A1:B5", HasHeaderRow = true });

    var analytics = book.Analytics;
    return await control.SaveAsync(StreamType.PDF);
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Creating Dashboards](https://docs.textcontrol.com/tx-sheet-control/dashboards/creating/llms-full.txt)

---

## In This Section

- [Analytics.DataAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/dataasync-method/llms-full.txt): Analytics.DataAsync method in the TX Sheet Control .NET API: Returns at most 1,000 filtered source rows for an application-authorized inspection workflow.
- [Analytics.ProfileAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/profileasync-method/llms-full.txt): Analytics.ProfileAsync method in the TX Sheet Control .NET API: Profiles up to 250,000 cells per source; mixed or identifier fields receive diagnostics.
- [Analytics.QueryAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/queryasync-method/llms-full.txt): Analytics.QueryAsync method in the TX Sheet Control .NET API: Executes a bounded, cooperatively scheduled aggregation independently of the editor UI.
- [Analytics.RefreshAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/refreshasync-method/llms-full.txt): Analytics.RefreshAsync method in the .NET API: Refreshes source columns/aggregates and raises DataRefreshRequested for host-scheduled live queries.
- [Analytics.RelationshipsAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/relationshipsasync-method/llms-full.txt): Analytics.RelationshipsAsync method in the TX Sheet Control .NET API: Lists explicitly configured many-to-one joins; suggestions are never silently applied.
- [Analytics.RemoveRelationshipAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/removerelationshipasync-method/llms-full.txt): Analytics.RemoveRelationshipAsync method in the TX Sheet Control .NET API: Deletes a relationship by stable ID. Includes the syntax and a C# example.
- [Analytics.RemoveSourceAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/removesourceasync-method/llms-full.txt): Analytics.RemoveSourceAsync method in the TX Sheet Control .NET API: Removes an explicit binding. Dependent widgets report missing-source errors.
- [Analytics.SetDataAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/setdataasync-method/llms-full.txt): Analytics.SetDataAsync method in the TX Sheet Control .NET API: Atomically replaces a connector's transient data. Includes the syntax and a C# example.
- [Analytics.SetRelationshipAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/setrelationshipasync-method/llms-full.txt): Analytics.SetRelationshipAsync method in the TX Sheet Control .NET API: Validates unique lookup keys before creating or replacing a relationship.
- [Analytics.SetSourceAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/setsourceasync-method/llms-full.txt): Analytics.SetSourceAsync method in the TX Sheet Control .NET API: Adds or explicitly replaces a validated source binding.
- [Analytics.SourcesAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/sourcesasync-method/llms-full.txt): Analytics.SourcesAsync method in the TX Sheet Control .NET API: Discovers worksheet bindings and explicitly registered logical connector queries.
- [Analytics.SuggestRelationshipsAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/suggestrelationshipsasync-method/llms-full.txt): Analytics.SuggestRelationshipsAsync method in the TX Sheet Control .NET API, with the return type Task<AnalyticsRelationshipSuggestion[]> and a C# example.

---

## Nearby

- **Previous:** [ActiveView.Type Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/activeview/type-property/llms-full.txt)
- **Next:** [Analytics.DataAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analytics/dataasync-method/llms-full.txt)
