This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Fix for statistics pipline to display proper last 6 weeks data around the new year #712
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replaced the ugly DATETIME to DATE conversion with the pretty one.
agr
requested review from
joelverhagen,
loic-sharma,
xavierdecoster,
shishirx34,
ryuyu,
chenriksson,
cristinamanum,
skofman1,
scottbommarito and
zhhyu
January 23, 2019 21:30
Would be possible to
We should only have multiple rows in the result with < 7 days if it's the end of the year. I think this would be a less drastic code change. |
We would be trading "drastic code change in C#" with "drastic code change in SQL" here. I'll take a look into it though. |
agr
changed the title
[WIP] Fix for statistics pipline to display proper last 6 weeks data around the new year
Fix for statistics pipline to display proper last 6 weeks data around the new year
Jan 31, 2019
OK, it ended up not that hard. |
scottbommarito
approved these changes
Jan 31, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome fix!
src/Stats.Warehouse/Programmability/Stored Procedures/dbo.DownloadReportLast6Weeks.sql
Outdated
Show resolved
Hide resolved
Should this really be against |
joelverhagen
reviewed
Feb 1, 2019
src/Stats.Warehouse/Programmability/Stored Procedures/dbo.DownloadReportLast6Weeks.sql
Outdated
Show resolved
Hide resolved
joelverhagen
approved these changes
Feb 1, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one.
shishirx34
approved these changes
Feb 1, 2019
joelverhagen
pushed a commit
that referenced
this pull request
Oct 26, 2020
… the new year (#712) * Replaced the `top 6` with `@MaxDate` Replaced the ugly DATETIME to DATE conversion with the pretty one. * Rewrote query to produce required data right away.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses NuGet/NuGetGallery#6836
Fix for the
DownloadReportLast6Weeks
sprocChanged the way
[dbo].[Fact_Download]
is joined to[dbo].[Dimension_Date]
: instead of direct join, aWeekLookup
CTE is introduced that limits the date range by itself and corrects the week number for dates around new year.In dev new sproc produces the following output:
Old sproc output:
Code fix
Not needed anymore since all is handled in SQL.