How to display week end date instead of week start date when aggregrating daily sales data to weekly
Hi,
I've got daily sales data that is currently aggregated in a WoW view in a bar graph in Domo - but the date on the x-axis shows the week start date. I'm trying to find a way to show the week end date on the x-axis instead in the same format ex: Current x-axis is displaying 2020-08-16 and I just need it to show as 2020-08-22 instead. I've tried various Beast Mode formulas/calculations based on my knowledge of SQL and so far, no luck. Any help would be appreciated!
Thanks,
E.
Comments
-
Hi @EM
You can utilize DAYOFWEEK and some simple math to get the last day of the week.
`Date` + INTERVAL (7 - DAYOFWEEK(`Date`)) DAY
The DAYOFWEEK function returns a number between 1 (Sunday) and 7 (Saturday). Subtracting that from 7 gives us the number of days until the end of the week which we just add that number of days to the exiting `Date` value.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- 10.8K All Categories
- 3 Private Company Board
- 1 APAC User Group
- 12 Welcome
- 39 Domo News
- 9.7K Using Domo
- 1.9K Dataflows
- 2.5K Card Building
- 2.2K Ideas Exchange
- 1.2K Connectors
- 343 Workbench
- 260 Domo Best Practices
- 11 Domo Certification
- 464 Domo Developer
- 50 Domo Everywhere
- 105 Apps
- 714 New to Domo
- 85 Dojo
- Domopalooza
- 1.1K 日本支部
- 4 道場-日本支部へようこそ
- 26 お知らせ
- 64 Kowaza
- 299 仲間に相談
- 653 ひらめき共有