Week of starting on Monday

I am having trouble with a "Week of" beast mode. Domo has the ability built into the cards to group the data by week. It does not, however, allow you to pick the start of the week. Our client wants the week to start Monday instead of Sunday. I have been trying to figure how to accomplish this. The below code works for all days except Saturday. For example, see the uploaded screenshot. The "week of" is set to Monday for all the dates except for Saturday. Saturday week of is Saturday. I am not following why this is happening but any help would be greatly appreciated.
DATE_SUB(Date
, INTERVAL
CASE
WHEN WEEKDAY(Date
) = 0 THEN 5 -- Saturday
WHEN WEEKDAY(Date
) = 1 THEN 6 -- Sunday
WHEN WEEKDAY(Date
) = 2 THEN 0 -- Monday
WHEN WEEKDAY(Date
) = 3 THEN 1 -- Tuesday
WHEN WEEKDAY(Date
) = 4 THEN 2 -- Wednesday
WHEN WEEKDAY(Date
) = 5 THEN 3 -- Thursday
WHEN WEEKDAY(Date
) = 6 THEN 4 -- Friday
END
DAY)
Best Answer
Answers
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Connect
- 1.3K Connectors
- 309 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 664 Datasets
- 120 SQL DataFlows
- 2.3K Magic ETL
- 824 Beast Mode
- Visualize
- 2.6K Charting
- 88 App Studio
- 46 Variables
- Automate
- 195 Apps
- 486 APIs & Domo Developer
- 93 Workflows
- 24 Code Engine
- AI and Machine Learning
- 23 AI Chat
- 4 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 119 Domo Everywhere
- 283 Scheduled Reports
- 11 Software Integrations
- Manage
- 143 Governance & Security
- 11 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 116 Community Announcements
- 5K Archive