Need to Show Actual Start and End Dates, not "This Week/Last Week/Last 2 Weeks"

G'day everyone 👋 I'm trying to use Smart Text (dynamic text) to show the dates being filtered, however the text comes through just as the filter looks (eg. This Week, Last Week, Last 2 Weeks, etc). Ideally, we'd like to show the actual dates being reported (eg. 08/12/2024 - 08/18/2024). I am a bit stuck trying to make this happen - any ideas/help would be greatly appreciated!
The images below show how it currently looks/behaves. What we'd like is for that text in the orange box to be the actual dates of the last week*, so the text there would read 08/12/2024 - 08/18/2024.
*We have a fiscal calendar where the week is Monday-Sunday, and this is in App Studio.
Truly appreciate any help or guidance. Thank you!
Best Answers
-
I don't do much with Smart Text but I think you'd need to create calculated fields to dynamically calculate the start and end dates with a label for the period you need.
Start Date of Last Week:
DATE_SUB(CURRENT_DATE(), INTERVAL (WEEKDAY(CURRENT_DATE()) + 6) DAY)
This calculates the Monday of the previous week.
End Date of Last Week:DATE_SUB(CURRENT_DATE(), INTERVAL WEEKDAY(CURRENT_DATE()) DAY)
This calculates the Sunday of the previous week.
Make sure the calculated fields are include on your dataset. Then use the calculated fields in the smart text something likeLast Week: {Start_Date_Field} - {End_Date_Field}
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1 -
you could also a summary number in your smart text to select the min and max date values
Alternatively you can do this in a beast mode and add the beast mode as smart text
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
Answers
-
I don't do much with Smart Text but I think you'd need to create calculated fields to dynamically calculate the start and end dates with a label for the period you need.
Start Date of Last Week:
DATE_SUB(CURRENT_DATE(), INTERVAL (WEEKDAY(CURRENT_DATE()) + 6) DAY)
This calculates the Monday of the previous week.
End Date of Last Week:DATE_SUB(CURRENT_DATE(), INTERVAL WEEKDAY(CURRENT_DATE()) DAY)
This calculates the Sunday of the previous week.
Make sure the calculated fields are include on your dataset. Then use the calculated fields in the smart text something likeLast Week: {Start_Date_Field} - {End_Date_Field}
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1 -
you could also a summary number in your smart text to select the min and max date values
Alternatively you can do this in a beast mode and add the beast mode as smart text
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Thank you @ArborRose and @GrantSmith. Truly appreciate the input. Going to test those solutions, fingers crossed! Thanks again!
0
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Data Connections
- 1.3K Connectors
- 309 Workbench
- 17 Cloud Integrations
- Data & ETL
- 2.3K Magic ETL
- 120 SQL DataFlows
- 666 Datasets
- 827 Beast Mode
- Visualize & Apps
- 90 App Studio
- 198 Pro-code Components
- 2.6K Charting & Analyzer
- 46 Calculations & Variables
- AI & Data science
- 23 Domo AI & AI Chat
- 4 Managing AI
- 18 Jupyter Workspaces
- 122 Workflows
- Distribute
- 118 Domo Everywhere
- 284 Reporting
- Manage
- 145 Governance & Security
- 489 APIs
- 11 Add-ins & Plugins
- 13 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 117 Community Announcements
- Automate
- 5K Archive