Skip to main content
Gathering Interest

Cognite Charts: Ability to calculate by subtracting two different time stamps on the same time series

Related products:Charts
  • Heet Vora

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?

@Crystal Connor Richards @Eric Stein-Beldring @Philippe Bettler 

2 replies

Eric  Stein-Beldring
Seasoned Practitioner

Hi Ibrahim,

This is actually possible to do today using the Shift time series function (found within the Operators 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 the Time periods to shift parameter and h (for “hours”) for the Time 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?


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

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