Execute an on-the-fly synthetic query
The list of queries to perform
required | Array of objects (SyntheticQuery) [ 1 .. 10 ] items |
List of datapoints for the specified queries.
Query error
expression = ''' 123 + ts{id:123} + ts{externalId:'abc'} + ts{space:'my-space',externalId:'my-ts-xid'} ''' dps = client.time_series.data.synthetic.query( expressions=expression, start="2w-ago", end="now") from cognite.client.data_classes.data_modeling.ids import NodeId ts = client.time_series.retrieve(id=123) variables = { "A": ts, "B": "my_ts_external_id", "C": NodeId("my-space", "my-ts-xid"), } dps = client.time_series.data.synthetic.query( expressions="A+B+C", start="2w-ago", end="now", variables=variables) from sympy import symbols, cos, sin x, y = symbols("x y") dps = client.time_series.data.synthetic.query( [sin(x), y*cos(x)], start="2w-ago", end="now", variables={x: "foo", y: "bar"}, aggregate="interpolation", granularity="15m", target_unit="temperature:deg_c")
{- "items": [
- {
- "isString": false,
- "datapoints": [
- {
- "timestamp": 1730204346000,
- "value": 0
}
]
}
]
}