Converting Seconds Into Minutes
Comments
-
You just need to use the SEC_TO_TIME() function for your seconds column.
Check out this article:
https://www.w3resource.com/mysql/date-and-time-functions/mysql-sec_to_time-function.php
Let me know if you have any questions,
ValiantSpur
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.1 -
Thanks ValiantSpur for the article. So I have a beastmode that calculates the seconds (column A devided by column B to get this number that I needed converted into hh:mm:ss. I tried to include that in the SEC_TO_TIME() function but it did not work. Any suggestions?
0 -
You may need to calculate the seconds column via a dataflow before attempting to use the Sec_To_TIME fucntion.
Also, what's the exact error message you're getting and could you provide an example of your code?
0 -
So this is what I tried sec_to_time(`abntime`/`abncalls`) and it was valid but returned nothing but 0.
0 -
So I created a new column in the ETL to divide the two columns to get my seconds, however the ETL is rounding up and dropping the decimal point. If I can find a solution to this, time_to_second function should work.
0 -
Have you tried converting the inputs to your calculation to decimals? This may prevent the rounding you are seeing if they are currently coming in as whole numbers.
0 -
It is not rounding to a whole number just to two decimal places. This is not an issue. My main concern is breaking down a minute and and fractions of minutes to minutes and seconds. Example: 2.25 minutes is 2 minutes and 15 seconds. I am stuck at converting the .25 into seconds and then adding it the 2 minutes, so my display will be 2.15 or 0:2:15.
Thanks for the assistance.
0 -
Sorry, when I was saying your rounding, I was referring to your ETL transform version and not the beast mode calculation.
If we go back to the beast mode formula, have you checked all of your inputs that they are strictly numbers? I did some testing and the SEC_TO_TIME worked fine for all postive whole numbers and decimal numbers, but had issues with text (including negative numbers that are formatted with parenthesis).
I would test this with a smaller set of data to see that it works as intended and then take a look at the inputs to make sure they are all of the correct format.
0 -
Thanks for your continued assistance. My imputs are in the correct format, so I am good there. Now, when I use time_to_sec, the beastmode drops the decimal and gives me just a whole number (2.25 becomce 2 and 1.85 becomes 1). I have reached out to Domo Support for assistance.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive