# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
NEW webinar Dec. 7th: 2023 Outlook, A Pivotal Year for Data Integration SIGN ME UP!
cancel
Showing results for
Did you mean:
Contributor III

## Show KPI as mm:ss

Hi all
I am trying to show a KPI in a mm:ss (minutes :seconds) manner.

This is the formula that I am using:  ' ' &'00:' & left(round (avg(ChatFirstResponse)),2)

and I'm getting:

I want to get in this case 01:03

defying the number formatting as duration doesn't work properly

Anyone has a suiable formula for that?

Thanks

Labels (3)

• ### Visualization

1 Solution

Accepted Solutions
Specialist III

hi

in your KPI just divide the result by 86400 and select format Time :

left(round (avg(ChatFirstResponse)),2) / 86400

then select correct time  format :

5 Replies
Specialist II

Since the result is displayed as a time value, then possibly this

Time(' ' &'00:' & left(round (avg(ChatFirstResponse)),2), 'hh-mm' )

Specialist III

hi

in your KPI just divide the result by 86400 and select format Time :

left(round (avg(ChatFirstResponse)),2) / 86400

then select correct time  format :

Contributor III
Author

' ' &'00:' & time(left(round (avg(ChatFirstResponse)),2))

I get

Employee

I'd say you should look into what @brunobertels recommended in his reply. Let the expression be a numeric, and use the duration formatting function for the expression.

Time is handled as a numeric value in Qlik Sense with the integer part representing days. This means that the number 1.5 represents a duration of one and a half days. It looks like the number you want to represent as time represents seconds, and one second is 1/86000 of a day (60*60*24), so simply divide you expression by that number.

So to sum it up: Don't do formatting directly in the expression, but rather turn it into a numeric representation of days. Then you can use the formatting functionality of the measure to format it into a nice string representation.

Contributor III
Author

That works perfectly, Thanks a lot!

Tags
Community Browser