Is there a way to combine/transform a Date&Time column into Domo?
So I've built a data set in another program, Midas, that I created a workbench job for and pulled it onto Domo. It has columns such as "IP Start Date" and "IP Start Time" and similar for discharge times etc. An end user is wanting to see patients broke down by Admit date, military time, and specific length of stay like "1.6" days etc.
So I was thinking of doing a date difference calculation for current date/time - the combined columns of IP start date and time. The problem I am encountering is that from Midas the start date/time is in the form of "MM/DD/YYYY" and time is military like "1706". However once the data goes through the workbench it shows in Domo for it's column in the following format "YYYY-MM-DD" and date changes to "2022-11-09T11:46:00-05:00".
Is there a way to transform the DOMO day/date format to match how it comes out of Midas and then use a date diff fxn or similar to achieve the format I mention above of "Admit Date, Admit Time via Military Time, Specific length of stay" in a table card or similar.
Answers
-
That's how dates data types are formatted within Domo. If you're wanting to change the format you can use a DATE_FORMAT function in a beast mode to convert it to a string by passing in the appropriate formatting string. See https://www.w3schools.com/mysql/func_mysql_date_format.asp
As for calculating the differences between two dates I've written up a post about this here: https://dojo.domo.com/main/discussion/52682/domo-ideas-conference-beast-modes-time-difference-formatting#latest
It'll get you close to what you're wanting to do. You'll likely want to remove the FLOOR function since you're wanting decimal places instead of whole elapsed days. You can replace it with ROUND(..., 1) to round your value to one decimal place.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Gosh I'm trying to make sense of this, and I understand the concept overall but still struggling to get it to work right within my dataset. Like where are you pulling the universal timestamp from? I know how to get current date/time to use for calculations but not familiar with that one.
0 -
@GrantSmith ignoring my last comment as I figured out what I was doing wrong. Focusing strictly on using the round function for elapsed days it works to take it down to 1 decimal with the Round(..., 1) but it leaves the trailing 0. For example if all the days its using is (1.91, 27.76, 16.95) etc it would round it to (1.90,27.80,17.00) is there a way to format it where it drops that tenths place 0 that it creates after the round function?
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 58 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 395 Distribute
- 113 Domo Everywhere
- 276 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive