question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[SEMANTIC-87] [Feature] Enable Unbounded Rolling Secondary Calculation

See original GitHub issue

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 not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

For the Rolling Secondary Calculation, I propose interval can be optionally None which would default the window frame of the function to rows between unbounded preceding and current row. In this scenario, the aliased metric name would simply be rolling_[metric_name].

Describe alternatives you’ve considered

I’m currently overriding the macro(s) to enable unbounded to be injected rather than interval - 1 to enable this. I considered injecting a larger integer, but Snowflake limits the window frame to 1000 rows when it’s specified. I also considered doing this via the BI layer, but that would require including all metric data in the view (i.e. can’t be filtered) and would be difficult to maintain.

Who will this benefit?

For many metrics, a complete cumulative view over time is incredibly valuable (ex. subscriber count).

Are you interested in contributing this feature?

Yes, I can contribute to complete this

Anything else?

From what I can tell, updates would be needed:

The Configuration Validation could use updating since it’s using the incorrect terminology for the existing error message (it says period_over_period rather than rolling).

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
andresrecaldecommented, Nov 17, 2022

Hey @callum-mcdata, so sorry I missed these messages; it’s been a hectic few weeks! I haven’t had a second to work on this, so very excited it’s making it in!

0reactions
callum-mcdatacommented, Nov 18, 2022

No need to apologize, I totally understand! This PR should be merged in by midday and then be part of the 1.3.2 release later today! The TLDR is that interval is now an optional input and if no interval is provided then it defaults to an unbounded rolling calc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · dbt-labs/dbt_metrics - GitHub
[SEMANTIC-135] [Feature] Support source macro in dbt_metrics model configuration ... [SEMANTIC-87] [Feature] Enable Unbounded Rolling Secondary Calculation ...
Read more >
Table Calculation Types - Tableau Help
For each mark in the view, a Moving Calculation table calculation (sometimes referred to as a rolling calculation) determines the value for a...
Read more >
5 Practical Examples of Using ROWS BETWEEN in SQL
Here are 5 examples demonstrating how the ROWS clause in SQL window functions can be used to calculate running totals, moving averages, ...
Read more >
Rolling Calculations in Widget Metrics
Rolling calculations are a means of applying a metric over a set of data points composed of multiple periods. Options include rolling averages...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found