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
- Product Ideas
- 2K Ideas Exchange
- Connect
- 1.3K Connectors
- 308 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 661 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 819 Beast Mode
- Visualize
- 2.5K Charting
- 85 App Studio
- 46 Variables
- Automate
- 193 Apps
- 483 APIs & Domo Developer
- 85 Workflows
- 23 Code Engine
- AI and Machine Learning
- 22 AI Chat
- 3 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 116 Domo Everywhere
- 282 Scheduled Reports
- 11 Software Integrations
- Manage
- 142 Governance & Security
- 9 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 5K Archive