Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
RoyBatty
Contributor III
Contributor III

We can't convert the avg number of seconds to time format (we tried various solutions from this forum)

Hi,

We have a measure that calculates the average value in seconds:

Avg([ticket_stats.first_agent_response_time])

(`ticket_stats.first_agent_response_time` is the number of seconds, and in Data model viewer it shows that it is $numberic $integer)

The result is values ​​like:

  • 14,186.87
  • 53,156.22
  • 61,339.88
  • 29,087.98
  • 8,725.44

RoyBatty_0-1721250449725.png

We want to present those values ​​(which are in seconds) in a time format, D hh:mm:ss or maybe just hh:mm:ss (we are still not sure which format will suit us better).

However, the problem is that we don't know how to do it. We searched the forum, we found many posts/solutions, but none of them work in our case. For example:

=Interval(Avg([ticket_stats.first_agent_response_time])/86400,'D hh:mm:ss')

Result:

RoyBatty_1-1721250710833.png

 

Also, the other solutions didn't work either:

=Interval(Avg([ticket_stats.first_agent_response_time])/86400, 'hh:mm:ss') 

=Interval(Interval#(ceil(Avg([ticket_stats.first_agent_response_time])),'s'), 'hh:mm:ss')

=time(Avg([ticket_stats.first_agent_response_time])/3600/24, 'hh:mm:ss')

=interval(timestamp#(ceil(Avg([ticket_stats.first_agent_response_time])), 's'), 'hh:mm:ss')

=Time(Avg([ticket_stats.first_agent_response_time])/24/60/60,'hh:mm:ss')

Do you have any suggestions?

Labels (1)
1 Solution

Accepted Solutions
RoyBatty
Contributor III
Contributor III
Author

The problem is that "Number" was selected for Number formatting 😑. Now, when I selected "Auto" - everything is ok.

=Interval(Avg([ticket_stats.first_agent_response_time])/86400,'hh:mm:ss')

 

RoyBatty_2-1721320188623.png

 

View solution in original post

3 Replies
Lisa_P
Employee
Employee

When I use the number it works:

Lisa_P_0-1721259764186.png

 

RoyBatty
Contributor III
Contributor III
Author

@Lisa_P 

RoyBatty_0-1721319568119.png

RoyBatty_1-1721319585201.png

 

RoyBatty
Contributor III
Contributor III
Author

The problem is that "Number" was selected for Number formatting 😑. Now, when I selected "Auto" - everything is ok.

=Interval(Avg([ticket_stats.first_agent_response_time])/86400,'hh:mm:ss')

 

RoyBatty_2-1721320188623.png