Solved

Synthetic timeseries api returns error for string timeseries

  • 29 November 2022
  • 3 replies
  • 42 views

Badge

Hi,

Cognite grafana plugin internally use synthetic timeseies api while passing query under “time series custom query” option. but synthetic timeseries api returns error while trying to retrieve data-point for string timeseries. 

please check out attached screenshot.

icon

Best answer by Dilesha Kodithuwakku 30 November 2022, 09:38

View original

3 replies

Userlevel 1
Badge +1

Hi Mitul,

The synthetic timeseries queries can not be used for string timeseries. If you want to handle it you need to convert string timeseries to double. For further information please refer to the documentation.

Best regards,
Dilesha

Userlevel 3

Hi Mitul, 

I hope Dilesha’s answer helped. If not, please let us know!

 

Userlevel 2

When using synthetic time series you can do a mapping from string to a number to get out results, this might help your use case:

Map the strings OPEN → 1 and CLOSED → 0

map(TS{externalId='stringstate'}, ['OPEN', 'CLOSED'], [1, 0], -1)

Doc: https://docs.cognite.com/dev/concepts/resource_types/synthetic_timeseries/#convert-string-time-series-to-doubles

 

Reply