I have a use case here where i would like to take a value reading at 9am on a time series and then one at 4pm but then i want to subtract it and have that as a synthetic time series going forward. Can we do this in Charts?
Cognite Charts: Ability to calculate by subtracting two different time stamps on the same time series
Charts
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Hi Ibrahim,
This is actually possible to do today using the
Shift time series
function (found within theOperators
category when you are adding a function node).To shift the time series “backwards” 7 hours (9am 4pm), then you should use
-7
as the input for theTime periods to shift
parameter andh
(for “hours”) for theTime periods unit parameter
.See image below:
Important note:
Since we currently do not fetch data beyond the range currently in view in the chart plot, there will be a gap at the start or end of the of the range (depending on whether you shift the forwards or backwards) of that period length.
If you'd like to calculate for a larger range, you can simply zoom out or change the time window in view. Adding the functionality to run calculations on a user-defined range of time, including fetching data outside the range in view is a request we've received and have on our backlog.
For the scenario you described, I’m hoping this current limitation won’t be an issue — do you believe this will solve your use case?