You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
While migrating a weekly dashboard from Excel to Superset, I found that time grain "Week starting Monday" doesn't select the proper data set.
As far as I understand, when selecting "Week starting Monday" should consider a week from Monday to Sunday, and using Monday as the label for that data aggregation. While time grain "Week ending Sunday" should consider the same time frame but will label the data aggregation uising the Sunday date. Despite the label, both should take the same days for each week.
When I select "Week ending Sunday" I obtain the correct sum for the week, however, when using "Week starting Monday" it takes data from Tuesday to Monday rather than from Monday to Sunday.
I'm attaching the dataset I'm using and two screenshots for the two charts.
I'm using superset 4.1.1
Warm regards.
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.11
Node version
16
Browser
Chrome
Additional context
No response
Checklist
I have searched Superset docs and Slack and didn't find a solution to my problem.
I have searched the GitHub issue tracker and didn't find a similar bug report.
I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
The text was updated successfully, but these errors were encountered:
Hey @AdrianMastronardi! I'm here to help you with any bugs, questions, or contribution guidance you may need. Let's squash those bugs together! 🐞
The issue you're experiencing with the "Week starting Monday" time grain in Superset 4.1.1 is due to the way the time grain expression is defined in the code. The expression for TimeGrain.WEEK_STARTING_MONDAY calculates the start of the week by finding the previous Monday and then subtracting 7 days, which effectively shifts the start of the week to Tuesday of the previous week. This results in a week that runs from Tuesday to Monday, rather than the expected Monday to Sunday [1].
This behavior is inconsistent with the expected behavior, which should format the date range starting from Monday to the following Sunday [2]. There is a known issue related to this in the Superset GitHub repository, and it has been mentioned as a bug fix in the changelog [3].
To address this, you might need to adjust the time grain expression in your Superset configuration or wait for an update that resolves this issue.
Bug description
Hi,
While migrating a weekly dashboard from Excel to Superset, I found that time grain "Week starting Monday" doesn't select the proper data set.
As far as I understand, when selecting "Week starting Monday" should consider a week from Monday to Sunday, and using Monday as the label for that data aggregation. While time grain "Week ending Sunday" should consider the same time frame but will label the data aggregation uising the Sunday date. Despite the label, both should take the same days for each week.
When I select "Week ending Sunday" I obtain the correct sum for the week, however, when using "Week starting Monday" it takes data from Tuesday to Monday rather than from Monday to Sunday.
I'm attaching the dataset I'm using and two screenshots for the two charts.
I'm using superset 4.1.1
Warm regards.
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.11
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: