Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SL-1711] [Feature] Support resolution of time dimension grain when using Dimension() object syntax #1033

Open
3 tasks done
Jstein77 opened this issue Feb 15, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request linear Medium priority Created by Linear-GitHub Sync Metricflow Created by Linear-GitHub Sync triage Tasks that need to be triaged

Comments

@Jstein77
Copy link
Contributor

Jstein77 commented Feb 15, 2024

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could ncot find an existing issue for this feature
  • I am requesting a straightforward extension of existing metricflow functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Currently we only support ambiguous resolution of time grains if you use the TimeDimension() object syntax. For example:

select
*
from {{semantic_layer.query(
metrics = ['revenue'],
where = "{{TimeDimension('metric_time')}} > 2024-01-01"
)
}}

Will resolve to the lowest granularity for metric time. If instead, I use the Dimenson() object syntax this query will error

select
*
from {{semantic_layer.query(
metrics = ['revenue'],
where = "{{Dimension('metric_time')}} > 2024-01-01"
)
}}

We should be able to resolve to the lowest available granularity for either syntax.

This is currently blocking implementing supporting date_part in Tableau.

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

No response

Anything else?

No response

From SyncLinear.com | SL-1711

@Jstein77 Jstein77 added enhancement New feature or request triage Tasks that need to be triaged labels Feb 15, 2024
@Jstein77 Jstein77 changed the title [Feature] Support resolution of time dimension grain when using Dimension() object syntax [SL-1711] [Feature] Support resolution of time dimension grain when using Dimension() object syntax Feb 15, 2024
@Jstein77 Jstein77 added linear Medium priority Created by Linear-GitHub Sync labels Feb 15, 2024
@Jstein77 Jstein77 added the Metricflow Created by Linear-GitHub Sync label Feb 15, 2024
@aiguofer
Copy link

One thing to add is that the use of {{ Dimension... }} and {{ TimeDimension... }} in filters inconsistent.

We need to be able to create a filter with:

  • No grain, no date part ("exact date" in tableau)
  • Only grain (DATE_TRUNC query in tableau)
  • Only date part (EXTRACT query in tableau)

Currently, it seems like each syntax supports some (different) subset of these scenarios. I think either one or both of the different syntax should be able to cover all 3 scenarios.

@Jstein77
Copy link
Contributor Author

@jordan.stein to see if this is fixed

@Jstein77 Jstein77 added this to the v.15 milestone Feb 27, 2024
@Jstein77 Jstein77 modified the milestones: v.15, v.16 Mar 12, 2024
@Jstein77 Jstein77 modified the milestones: v.16, v.17 Mar 26, 2024
@Jstein77
Copy link
Contributor Author

Jstein77 commented Apr 4, 2024

Good one to followup on when caching is done.

@Jstein77 Jstein77 modified the milestones: v.17, v.19 Apr 23, 2024
@Jstein77 Jstein77 modified the milestones: v.19, v.20 May 7, 2024
@Jstein77 Jstein77 removed this from the v.20 milestone May 16, 2024
@Jstein77 Jstein77 added this to the MetricFlow Sprint milestone Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request linear Medium priority Created by Linear-GitHub Sync Metricflow Created by Linear-GitHub Sync triage Tasks that need to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants