Skip to main content
Solved

Aggregates of synthetic timeseries on templates / datapointsWithGranularity


Forum|alt.badge.img+4

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.

I hope this helps!

View original
Did this topic help you find an answer to your question?

2 replies

Anita Hæhre
Seasoned Practitioner
Forum|alt.badge.img+1
  • Head of Academy and Community
  • 590 replies
  • June 14, 2022

  • Practitioner
  • 3 replies
  • Answer
  • June 14, 2022

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


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings