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.4K Product Ideas
- 1.4K Ideas Exchange
- 1.4K Connect
- 1.2K Connectors
- 284 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.9K Transform
- 88 SQL DataFlows
- 554 Datasets
- 2.2K Magic ETL
- 3.3K Visualize
- 2.3K Charting
- 563 Beast Mode
- 9 App Studio
- 27 Variables
- 577 Automate
- 140 Apps
- 414 APIs & Domo Developer
- 22 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 350 Distribute
- 90 Domo Everywhere
- 258 Scheduled Reports
- 2 Software Integrations
- 91 Manage
- 88 Governance & Security
- 9 Product Release Questions
- Community Forums
- 42 Getting Started
- 28 Community Member Introductions
- 85 Community Announcements
- 4.8K Archive