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
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 302 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 104 SQL DataFlows
- 636 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 761 Beast Mode
- 65 App Studio
- 42 Variables
- 701 Automate
- 182 Apps
- 457 APIs & Domo Developer
- 52 Workflows
- 10 DomoAI
- 39 Predict
- 16 Jupyter Workspaces
- 23 R & Python Tiles
- 401 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 8 Software Integrations
- 132 Manage
- 129 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 111 Community Announcements
- 4.8K Archive