Convert all dates to last day of year
I am trying to convert all my dates to the last day of the year in a beast mode. I have a column in my dataset that is already showing the year for the data and have tried this
STR_TO_DATE( CONCAT(`YEAR`,'-',12,'-',31),' %Y-%m-%d ')
It doesn't seem to work. Any help would be appreciated
Comments
-
Not sure if it was a typo or not... but you have some commas in strange places. Try this:
STR_TO_DATE(CONCAT(`YEAR`,'-12-31'),'%Y-%m-%d')
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman3 -
@apatten You also had spaces extra spaces in your date format qualifiers, which would prevent it from recognizing the dates. @ST_-Superman-_ 's formula should fix that.
1 -
For another option:
STR_TO_DATE(`y` + 1, '%Y') - 1
'%Y'
- defaults to the first of the year+1
Add a year-1
Subtracts a dayy
here is the year in integer format.In other words, it's converting the given year to be the first day of the next year then subtracting 1 day to get the last day of the given year
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 297 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 678 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive