Date minus a few weeks
Hello guys,
Am looking for code which states:
Return X (actuals) between (current date minus 3 weeks) and (current date minus 2 weeks).
The code I am currently writing is not returning the correct values for the correct dates.
Could someone help me out please?
Many thanks to the community,
0
Best Answer
-
Here's the basics on how I would write this as a beast mode:
CASE WHEN `Date` >= DATE_SUB(CURRENT_DATE(), INTERVAL 3 WEEK) AND `Date` <= DATE_SUB(CURRENT_DATE(), INTERVAL 2 WEEK)
THEN `Actuals`
ENDHope that helps,
Valiant
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.2
Answers
-
Here's the basics on how I would write this as a beast mode:
CASE WHEN `Date` >= DATE_SUB(CURRENT_DATE(), INTERVAL 3 WEEK) AND `Date` <= DATE_SUB(CURRENT_DATE(), INTERVAL 2 WEEK)
THEN `Actuals`
ENDHope that helps,
Valiant
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.2
Categories
- 10.5K All Categories
- 8 Connect
- 918 Connectors
- 250 Workbench
- 470 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 477 Datasets
- 193 Visualize
- 252 Beast Mode
- 2.1K Charting
- 11 Variables
- 17 Automate
- 354 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 247 Distribute
- 63 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 174 Product Ideas
- 1.2K Ideas Exchange
- 12 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive