Skip to main content
Seasoned ⭐️
Nov 29, 2022 9:11 AM UTC
Solved

Synthetic timeseries api returns error for string timeseries

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.

Expert ⭐️⭐️⭐️⭐️
Nov 30, 2022 8:38 AM UTC

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

3 replies

Expert ⭐️⭐️⭐️⭐️
Nov 30, 2022 8:38 AM UTC

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

Expert ⭐️⭐️⭐️⭐️
Dec 2, 2022 9:58 AM UTC

Hi Mitul, 

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

 

Murad Sæter
Practitioner ⭐️⭐️⭐️
Practitioner ⭐️⭐️⭐️
Feb 6, 2023 11:41 AM UTC

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