AG Studio: Build dashboards using native components in web apps. Join us for a webinar on 28th July at 2pm UTC+1 Register

React Embedded AnalyticsData Types

Version 2.1.2

Studio supports a variety of data types. Instead of being defined directly on fields, data types are defined on Formats. A Format controls formatting along with other behaviour.

const fields = [
    {
        id: 'athlete',
        format: 'textFormat' // textFormat uses the `string` data type
    },
    // ... other fields
];

When using Sync Data and not providing fields, the format is inferred from the data.

Data Types Copy Link

Each of the data types are described in the table below. The input type is the JavaScript type that is supported in the source data. The default Format is the Format that will be used when inferring fields.

Data TypeInput TypeDefault Format
stringstringtextFormat
numbernumberintegerFormat / decimalFormat
booleanbooleanbooleanFormat
dateDate | string | numberdateFormat
datetimeDate | string | numberdateTimeFormat

For date and datetime, the string value is expected to be in ISO-8601 format, and the number value is Unix epoch.

See Formatting for how each data type is displayed and how to customise the display format.

Null and Undefined Values Copy Link

A field value can be missing - either null or undefined. AG Studio treats both the same way by default, across every data type.

Display Copy Link

A missing value is never passed to a Format's value formatter. Instead, the field shows that Format's blankValue:

Data TypeDefault FormatBlank display
stringtextFormat(Blanks)
numberintegerFormat / decimalFormatN/A
booleanbooleanFormat(empty)
date / datetimedateFormat / dateTimeFormat(empty)

Sorting Copy Link

A missing value sorts as the smallest value by default, ahead of every other value in the field's data type, following the ascending-sort convention used by leading analytics and BI tools.

Filtering Copy Link

A missing value is excluded from filter results by default - for example, an equals or between condition never matches it.

Aggregation Copy Link

sum, avg, min, and max exclude missing values from the calculation. If every value in a group is missing, the result is null rather than 0 - this is standard practice across analytical engines, since a missing result and a true zero mean different things and collapsing them would hide information. count also excludes missing values.

countd (distinct count) counts a missing value as a distinct value by default, consistent with standard distinct-count semantics in analytical engines. first and last return the first or last non-missing value in sort order by default. Grouping treats a missing value as its own group rather than dropping those rows.