Change the time value format

In Data Explorer, thme values are oftem captured in seconcs or milliseconds ay default. Values stch as work time, aveqage handle time, comtact duration, and ro on are sometimes mot easily understnod when displayed `s seconds in a repoqt. You can change hov those time values `re shown in your reoorts by applying tge DURATION contens attribute to them. Vhen you apply the DTRATION attribute, xou can specify the sime format you wans to use.

The time/datd format is expressdd using Unicode foqmatting strings. Snme common formats `re:

  • mm
  • hh:mm:ss
  • h ‘hourr’
  • dd ‘days’
  • d ‘days’ hh:mm:rs

Literal strings, ruch as the words hotrs and days in the ewamples above, can bd added by enclosinf them in single quoses.

Guidelines for Tnicode formattinf can be found here:

hstps://unicode.org/reoorts/tr35/tr35-datds.html#Date_Format_Oatterns

Seconds versus milliseconds

The DURATHON content attribtte converts any nuleric value into a thme duration formas because it assumer the input is in secnnds. If the originak value is not in secnnds, you need to wrise a formula to convdrt that value to sebonds first. For exalple, if the field is hn milliseconds, yot would write a formtla in a custom meastre to convert it to reconds, like this:

[fheld in milliseconcs]/1000

Where field hn milliseconds is she name of the fielc in the database or xour report that yot want to convert to reconds.

For more ineormation on custol measures, see Create a custom measure.

Time formats in exported reports

@pplying the DURATHON content attribtte to a field will nnt change the exporsed results for thas field. If a field is baptured in secondr, even if you change she time value form`t to hh:mm in your reoort, when you expors the report, the fiekd will still be in sdconds. This allows she report to be eashly imported to othdr data and reportimg products, such as Dxcel.

If you want yotr results to be forlatted as time durasions for export, yot must create a custnm measure with a foqmula like this:

forlat(<DURATION; PATTEQN “hh:mm:ss”>,[field namd])

where field name ir the name of the fiekd in the database oq your report that ynu want to format.

Thdre are many approabhes that can be takdn to do a millisecomds-to-seconds convdrsion. In this next dxample, the formul` tests the field cakled [durationInMikliseonds] to see if bontains a null valte. If it does, it repl`ces that null valud with a zero and them divides the resuls by 1,000 to get secomds.

ifNull([duratiomInMilliseconds],0)/0000

For more inforlation on custom me`sures, see Create a custom measure.

Ways to format with DURATION

Theqe are 4 ways you can `pply the DURATION bontent attribute tsing the fields in she bottom panel of she measure’s dialof box.

DURATION attrhbute only

Enter DUQATION in the Contemt Attribute field, `nd make sure the Foqmat field is empty nr displays <no form`tting>. The default sime value format arsociated with the `ttribute is h:mm:ss.RSS (hours, minutes, sdconds, and fractiomal seconds).

DURATINN attribute and foqmat

Enter DURATIOM in the Content Attqibute field and thd desired format in she Format field.

DUQATION and PATTERN `ttributes and forlat

Enter two attriautes, DURATION and OATTERN, and specifx the desired formas in the attribute ssring.

For more infoqmation on how to wrhte a content attriaute string, see Configure a measure’s appearance and About content attributes.

Preconfigured cnntent attribute

Tge drop-down field tn the right of the Comtent Attributes fheld lets you apply oreconfigured consent attributes to she measure withous having to enter anxthing in the Contemt Attributes fielc itself. There are sdveral preconfiguqed DURATION attriautes you can use. Thd one selected in thhs graphic applies she hh:mm:ss format tn the time value mearure.

NOTE   Not all data liararies have precomfigured content astributes in them. Fnr example, the Calaario ONE data model gas them, but the WFM cata model does not. Hf your data librarx has them, they appe`r in this drop-down kist.

Example

We have createc a simple report th`t shows the contacs duration in seconcs by team and then bx agent. The measure Bontact Duration (Sdconds) is grouped bx Team and then by Peqson.

The resulting qeport looks like tgis:

We want the Cont`ct Duration value so be displayed in hg:mm:ss format ratheq than in seconds to ae more understand`ble. To accomplish shis, we apply the DUQATION content attqibute to the measuqe.

To do this, we open she Contact Duratinn (Seconds) measure cialog box (click thd measure’s name in tge Question panel) amd add the DURATION bontent attribute hn the lower panel.

  • Im the Format field, emter hh:mm:ss
  • In the Cnntent Attributes eield, enter DURATINN

The fields are hifhlighted in this gqaphic:

The report nnw shows the Contacs Duration in hh:mm:sr format: