Skip to main content
Version: Streamsheets 3.0

Timeseries Functions

Often it is important to not only work with single real-time data points at the moment but to build a history and work with a series of values. In the Chart section, we discussed ways of data representation, but we have not discussed how to gather this data in Eclipse Streamsheets and how real-time updates work. The following solutions are constructive in situations where permanent data storage is unnecessary. To permanently save your data, connect Streamsheets to a database like MongoDB, InfluxDB or TimescaleDB.

Timeseries functions

Using the table in sheets feels natural, but holding vast chunks of data on a Streamsheet is not always the best decision (especially if you don´t want to display the whole table and only use it as a base for charts). Tables cover a lot of space, which should be used for implementing your logic. This is where timeseries functions come into play:

These functions track a cell and store the observed changes & timestamps over a certain amount of time. They create an invisible table fitted into one cell. The result is that now Charts can use one function as a data range instead of huge tables. While the TIMESTORE function is used as a base for one or more TIMEQUERY functions, the TIMEAGGREGATE works on its own.

TIMESTORE & TIMEQUERY: TIMESTORE and TIMEQUERY operate like a short-term database. The TIMESTORE function saves key-value pairs over a specified period. It creates a data table like accurate data, which the TIMEQUERY function can query. It is possible to query original values and aggregate and filter the data. You can add one or more TIMESTORE functions per Streamsheet, and one or more TIMEQUERY functions can reference every TIMESTORE.

RTS
Storing the key value pairs of Berlin, London and Paris

RTQ
Adding queries on top of the TIMESTORE()

TQA TQW
Adding charts on top of the TIMEQUERY functions

TIMEAGGREGATE: The TIMEAGGREAGATE function is a quick hack of TIMESTORE and TIMEQUERY. It monitors one key-value pair over a specified time. As the TIMESTORE function, it stores the raw values and timestamps within the cell while displaying the aggregated value as the cell value.

RTAM
TIMEAGGREGATE(B6,,4) uses B6 as the data source and is set to method "4". which determines the maximum of all received values. To display the aggregated value, reference it again in another cell (Max 122).

TAM
Now, you can use the cell of the TIMEAGGREGATE() function to display the raw data chart and the reference cell for the aggregation.

To create a chart with more than one data series, just use multiple TIMEAGGREGATE() or TIMEQUERY() functions as the source range.

info

#LIMIT appears when the set limit of stored key-value pairs is reached. This is not necessarily a problem. It only means that old stores will be overwritten by newer ones.