Forum Discussion
Aggregating Duration/Time
- 10 years ago
Sure, I can give a general solution but I have no clue as to what AHT refers to. Average Hours Talked? In any case, simple enough, I've done in a series of steps to make it readable.
Given a number of seconds "[Seconds]", create the following columns/measures or what not:
Hours = ROUNDDOWN([Seconds]/360,0)
Minutes = ROUNDDOWN(([Seconds]-[Hours]*360)/60,0)
Sec = MOD(([Seconds]-[Hours]*360),60)
H = IF(LEN([Hours])=1,CONCATENATE("0",[Hours]),CONCATENATE("",[Hours]))
M = IF(LEN([Minutes])=1,CONCATENATE("0",[Minutes]),CONCATENATE("",[Minutes]))
S = IF(LEN([Sec])=1,CONCATENATE("0",[Sec]),CONCATENATE("",[Sec]))
Text = CONCATENATE([H],CONCATENATE(":",CONCATENATE([M],CONCATENATE(":",[S]))))
Text comes out like 01:03:36 for a value of 576 seconds.
It works perfectly, but we need apply only against measure, not against common column!
Thanks