Widget Tricks - ods-adv-analysis

The ods-adv-analysis widget exposes the results of an aggregation function over a context. It uses the ODS Explore API V2 and its ODSQL language.

ods-adv-analysis documentation

Get the oldest (min) and newest (max) date in a field

min and max function can also work on date format field. It’s very useful to get the date range covered by the dataset on a specific field.

It can for example be used to initialise an ods-date-range-slider with the correct bounds.

ods-date-range-slider documentation

Sub-aggregation after ods-adv-analysis

The ods-adv-analysis widget can be use in conjunction with ods-subaggregation.

It will perform a second aggregation after the API result.

In the example, we use this technique to perform a daily average over a week, (from a second precision timeserie).

  1. ods-adv-analysis groups record by day over the last 7 days, and returns the total number of hits for each day.
  2. ods-subaggregation computes the average of hits by day.

ods-subaggregation documentation