Convert a time to a number

I have a user that has his own dataset and I am converting it so that it is all done through an ETL but the issue is that he has a Average Handling time of 06:32 but he wants to see it as 6.32.
I am have had to convert the times to decimal to work and then covert it back to time doing the following:
SEC_TO_TIME(
FLOOR(Decimal AHT
) * 3600 +
FLOOR((Decimal AHT
- FLOOR(Decimal AHT
)) * 60) * 60 +
ROUND(((Decimal AHT
- FLOOR(Decimal AHT
)) * 60 - FLOOR((Decimal AHT
- FLOOR(Decimal AHT
)) * 60)) * 60)
)
and this gives me Time to AHT which is 06:32:37
But now when when I try to convert the time to his format I get 6.00 and I am using this formula:
POWER( SEC_TO_TIME(
FLOOR(Decimal AHT
) * 3600 +
FLOOR((Decimal AHT
- FLOOR(Decimal AHT
)) * 60) * 60 +
ROUND(((Decimal AHT
- FLOOR(Decimal AHT
)) * 60 - FLOOR((Decimal AHT
- FLOOR(Decimal AHT
)) * 60)) * 60)
),1)
I have tried to use the 1*with that formula but I now get a blank.
I need to get a number because he is using a Horizontal graph to look at all of his agents.
Any suggestions are appreciated.
Thank you
Best Answers
-
Ok I think I made it work using Power() and having that crazy formula in there because it converted my text to a number that is actually visible.
0 -
Hello @JBerr,
Maybe I didn't understand your question, but isn't it possible to just use a simple REPLACE function like this:
CAST(REPLACE(
Time 1
, ':', '.') AS FLOAT)If you found this post helpful, please use 💡/💖/👍/😊 below! If it solved your problem, don't forget to accept the answer.
0 -
Hi Mansal,
That also worked!
0
Answers
-
You can try and use the FORMAT function to format your Date field to a string in the format you want:
FORMAT(`date`, '%H.%s')
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Hi Grant,
I tried it and kind of worked but its now a text and now trying to convert that to a number and I'll fail.
0 -
Ok I think I made it work using Power() and having that crazy formula in there because it converted my text to a number that is actually visible.
0 -
Hello @JBerr,
Maybe I didn't understand your question, but isn't it possible to just use a simple REPLACE function like this:
CAST(REPLACE(
Time 1
, ':', '.') AS FLOAT)If you found this post helpful, please use 💡/💖/👍/😊 below! If it solved your problem, don't forget to accept the answer.
0 -
Hi Mansal,
That also worked!
0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 659 Datasets
- 116 SQL DataFlows
- 2.2K Magic ETL
- 816 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 82 App Studio
- 45 Variables
- 776 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 82 Workflows
- 23 Code Engine
- 40 AI and Machine Learning
- 20 AI Chat
- 1 AI Playground
- 1 AI Projects and Models
- 18 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 144 Manage
- 140 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive