JavaScript Embedded AnalyticsData Setup

Understand how data is organised in the Data panel, structured across sources, and used in widgets.

AG Studio supports multiple data sources. This page explains how data is presented in the Data panel, how it is structured across sources, and how fields behave when used in widgets.

Data Panel Copy Link

The Data Panel lists the data available to the report, grouped by source. For an overview of how the Data Panel fits within the Studio interface, see User Interface.

The Data panel can be used to search for items by name. When a data pill is dragged, valid drop areas are highlighted in blue. Data pills can be dropped into widget configuration slots and Filter Conditions.

Clicking on any data item updates the Edit Panel to show the Data Details tab, which displays metadata about that item.

Data Items Copy Link

Data items are fields made available in the Data Panel. A field is a data element that can be used in widgets and is one of three types: a column, a calculated column, or a measure.

  • Columns are fields that come directly from the underlying data source and are typically used for categories (grouping) and, where appropriate, as values.
  • Calculated Columns are fields derived from other data that return a value for each row.
  • Measures are pre-aggregated calculations intended for Metrics and KPIs.

Each data item has the following properties:

PropertyDescription
IdThe unique identifier for the data item.
NameThe display name shown in the interface.
DescriptionAdditional supporting information about the data item.
Data TypeThe type of data the item contains, such as text, number, date, or boolean.
Calculation TypeThe type of field: whether it is a column, calculated column, or measure.
FormatHow the value is displayed in the interface, for example as text, currency, percentage, or a date format.

Click on any field in the Data Panel to open the Data Details tab and view the metadata about that field, including its name, description, data type, calculation type, and format.

Id, Name, and Data Type are required and configured by your developer. Description and Format are optional and also configured by your developer. Calculation Type is set automatically by AG Studio based on how the field is defined.

Data Source Copy Link

Data items shown in the Data Panel are grouped by data source. Reports can be powered by one data source or multiple data sources.

When the report uses a single data source, all fields and calculations come from the same source. Widgets can be configured without thinking about relationships.

When multiple data sources are used, data items and calculations remain scoped to their source. Calculations that reference multiple sources appear under the first source referenced in the expression.

If relationships exist between data sources, data items can be combined across sources when Configuring Widgets. If no relationship exists between selected data, the interface prevents invalid combinations.

When you use data from multiple sources, you can create widgets that combine data items from different sources. In the example below, the table widget displays product names from the Products table along with order metrics from the Order Items table, including quantity, unit price, and net sales.

Calculations Copy Link

Some fields in the Data panel are calculations rather than raw source columns. Calculations are defined by the developer and derived from other fields. They are computed at runtime rather than stored in the underlying data, so they update as the data changes. There are two types of calculations:

Calculated Columns — Non-aggregated calculations that return a value for each row. They are useful for transforming data (for example, cleaned labels), bucketing values (for example, a band), or computing flags based on logic.

Measures — Pre-aggregated calculations that compute values at the dataset level or per category. When a Measure is used without any grouping categories, it returns a single aggregated value for the entire dataset (for example, total revenue across all regions). When used with categories, it returns one value per category (for example, total revenue per region). Measures are intended for Metrics and KPIs and do not support changing aggregation at runtime.

Both Calculated Columns and Measures are derived from other fields and computed at runtime. The key difference is in their flexibility: Calculated Columns can have their aggregation method changed by users in widgets, whilst Measures have a fixed aggregation method that is predetermined by the developer.

IconDescription
Text data type
Number data types
Text data type
Calculated number data type

In the example below, the table demonstrates a measure grouped by product. Line Net (sum) is an aggregated column calculated from order items. Gross Margin % is a measure that shows the aggregated margin percentage for each product.

Data Types and Formats Copy Link

Each data item in the Data Panel also has a type and format that affect how it can be used and displayed. The data type determines what kind of data it contains, while the format determines how that data is displayed and processed in widgets.

Data Types Copy Link

AG Studio supports five core data types:

Data TypeIconDescriptionExamples
Text
Text data type
Letters, words, and alphanumeric charactersCountry, Product Name, Status
Number
Text data type
Integer or decimal valuesRevenue, Quantity, Price
Boolean
Text data type
True or false valuesIs Active, Has Discount
Date
Text data type
Calendar datesOrder Date, Delivery Date
Date Time
Text data type
Calendar dates with timeTimestamp, Created At

Formats Copy Link

A format controls how data is displayed in the interface. For example, a number might be displayed as 1,000, 1000.00, $1,000, or 100% depending on its format.

The following default formats are available in AG Studio:

Data TypeAvailable Formats
TextText (default display)
NumberInteger, Decimal, Percentage, Currency
BooleanBoolean (True/False)
DateDate (e.g., 31/12/2025)
Date TimeDate Time (e.g., 31/12/2025, 13:00:00)

The available formats and their display settings are configured by the application developer. Beyond the standard formats listed above, developers can also create custom formats tailored to specific business needs.

Format is a rendering option that affects only how values are displayed in a widget, it does not change the underlying data.

Grouping Copy Link

When a field is placed in a category slot in a Widget, or added as a column in a table, it is used as a Group by. This returns the unique values from that field and uses them to define the groups across which values are aggregated. For example, placing Region in a category slot groups the data so that each region appears as a distinct row or segment in the widget.

Group by is available on columns and calculated columns. It is not accepted in the value axis of visualisations.

Aggregation Copy Link

Aggregation defines how values are combined when a Widget summarises data across multiple rows. By default, AG Studio applies an aggregation when data is added as a widget value. The aggregation can be changed from the data pill menu. Available aggregations depend on the data type and input requirements.

Aggregation can be applied to columns and calculated columns. Measures are pre-aggregated and do not support additional aggregation.

NameShort LabelDescription
Sum(sum)Adds all values together.
Average(avg)Calculates the mean of all values.
Minimum(min)Returns the smallest value in the result set.
Maximum(max)Returns the largest value in the result set.
Count (Distinct)(countd)Counts the number of distinct values in the result.
Count(count)Counts the number of rows included in the result.
First(first)Returns the first value in the grouped result, based on the current data order.
Last(last)Returns the last value in the grouped result, based on the current data order.

Aggregated values respond to category grouping changes. For example, adding Region as a category to Total Sales produces total sales by region.

The following example demonstrates how aggregation responds to different category groupings. Using the Line Net calculated column, both tables apply two different aggregations: Average and Sum. The first table groups by store region and the second by customer segment. Notice how both the sum and average values change as the grouping categories change, illustrating how the same aggregation functions produce different results depending on the data grouped.

Sorting Copy Link

The sort order can also be changed from the data pill menu. Sort options include None, Ascending, and Descending. Each Widget can have one sort applied.