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.1K Connectors
- 282 Workbench
- 3 Cloud Amplifier
- 4 Federated
- 2.8K Transform
- 86 SQL DataFlows
- 548 Datasets
- 2.2K Magic ETL
- 3.2K Visualize
- 2.3K Charting
- 544 Beast Mode
- App Studio
- 26 Variables
- 566 Automate
- 134 Apps
- 411 APIs & Domo Developer
- 21 Workflows
- DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 345 Distribute
- 87 Domo Everywhere
- 257 Scheduled Reports
- 1 Software Integrations
- 85 Manage
- 84 Governance & Security
- 8 Product Release Questions
- Community Forums
- 41 Getting Started
- 27 Community Member Introductions
- 81 Community Announcements
- 4.8K Archive