Solved

Aggregates of synthetic timeseries on templates / datapointsWithGranularity


Userlevel 2
Badge +3

Hi. How can I get aggregated values from synthetic timeseries fields on templates? Intuitively, I would expect the “datapointsWithGranularity” operator in the graphQL query to give me this, but I get the same results as for the “datapoints” operator. 

Should the aggregation type and granularity be part of the definition of the synthetic timeseries field in the template? If so, how?

 

icon

Best answer by Emil Sandsto 14 June 2022, 14:58

View original

2 replies

Userlevel 6
Badge

@Emil Sandsto 

Hi,

Unfortunately, there is no support for aggregating a synthetic timeseries in the TimeSeries API, which is the reason for the lack of support in Templates. For these types of use cases, I recommend creating a Cognite Function that generates a time series with the calculated result. In other words replicate the calculation that you do today in the synthetic query into Python code, and ingest that result into a time series you create.

I hope this helps!

Reply