X-to-date ranges use incorrect (or at least unconventional) ranges #4066
Replies: 3 comments 2 replies
-
Just ran into this issue myself. It seems like a bug to me, or at least a bad choice for default behavior. For example, the way you describe is how Stripe's charting works: A chart for May 1 - May 18 for example will compare to the period of Feb 1 - Feb 18 by default. That way the comparison is actually useful. |
Beta Was this translation helpful? Give feedback.
-
PR has been made and is pending review. |
Beta Was this translation helpful? Give feedback.
-
After looking over this, we decided to merge the PR to match better what you're expecting from metrics. Consider it a bug fix for a long-standing issue. |
Beta Was this translation helpful? Give feedback.
-
Description:
Metrics with ranges such as "MTD" or "QTD" are supposed to compare the "month to date" or "quarter to date" with the previous time period. This is calculated with, for example:
This method always uses the full prior period (month, quarter, or year) rather than the prior period to date. This results in apples-to-oranges comparisons. For example, on the first day of a new year, the year-to-date comparison is comparing one day of activity to 365 days of activity.
Whether this counts as a "bug" is perhaps subjective, but it is at the very least counterintuitive and inconsistent with the way business and financial metrics like these are usually calculated.
I would happily offer a fix via a pull request, but I'm guessing you'd consider this a BC-breakage, so I'm not sure how to proceed.
If you disagree that this should be changed, then I can override the default in my own code base easily enough.
Thanks for listening!
Beta Was this translation helpful? Give feedback.
All reactions