Skip to main content
New

Feature Request: First and Last Value Aggregates for Granularity-Based Queries

Related products:API and SDKs
  • January 21, 2026
  • 0 replies
  • 8 views

Hello Cognite Support Team,

 

I'm working with the Cognite Data Points API and would like to request a feature enhancement regarding aggregation functions.

 

Current Situation: When querying time series data with a specific granularity (e.g., "1d" for daily), the available aggregates (Sum, Average, Count, Interpolation, StepInterpolation, etc.) don't directly provide the first or last actual data point within each granularity period.

 

Feature Request: Could you add first and last aggregate functions that would:

  • first: Return the earliest data point (by timestamp) within each granularity period
  • last: Return the latest data point (by timestamp) within each granularity period
  •  

Use Case Example: For a time series with granularity: "1d" and aggregates: ["first"], the API would return the first recorded value for each day (e.g., the value at 00:00 or the earliest available timestamp that day).

 

Similarly, aggregates: ["last"] would return the last recorded value for each day (e.g., the value at 23:00 or the latest available timestamp).

 

Current Workaround: Currently, we're fetching hourly data (granularity: "1h") and then manually filtering/grouping to extract the first or last value per day, which is less efficient for large datasets.

 

Question: Are there any plans to add native first and last aggregate functions? If this feature is already available through a different approach, I'd appreciate guidance on the best practice.