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?
Best answer by 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.
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.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.