Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Query specified timeDimension granularity offset? #10042

Open
Assignees
Labels
questionThe issue is a question. Please use Stack Overflow for questions.
@hank-sq

Description

Problem

I'd like to be able to customize the 'offset' of timeDimension granularities at query time. For example, I want to support a client that maybe wants to group by a time dimension with daily granularity, but for that day to map to 2:30am -> 2:30am.

For example, if there's the following data with a created_at time at:

  • 2025年01月01日T00:00:00Z
  • 2025年01月01日T01:00:00Z
  • 2025年01月01日T02:00:00Z
  • 2025年01月01日T03:00:00Z

I want the ability to have the query timezone be UTC, group by created_at with granularity daily, but offset that granularity by -2.5 hours, with the expected result (date, count):

  1. 2025年12月31日, 3
  2. 2025年01月01日, 1

I can define custom granularities for pre-defined offsets, but I want this to be able to be supplied by clients at query time. This is a viable but non-ideal workaround for supporting hour shifts, but moving to supporting minute shifts causes a significant number of custom granularities and bloats the data model.

This would also be an alternative to supporting weekly aggregations on different starting days of week, without adding 7 custom granularities to every time dimension.

I could pass in a timezone that maps to the required shift - but this is extremely unintuitive to ask a client to do, and doesn't fully solve the problem (for example, I'd still want to respect DST change in the client's actual timezone).

Is there a way to do this with cube today?

Metadata

Metadata

Labels

questionThe issue is a question. Please use Stack Overflow for questions.

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /