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: 
Not applicable

Display of calcul

Hi all,

Is someone can help me to solve my problem. In fact I made this script but not display me the right result. It shows me anything and I feel that the term is good.

Here is the script:

=sum({$< État={"Disponible"}>} Interval(Time#(Durée,'hh:mm:ss'),'mm') )/Max( interval(Time#(Heure,'hh:mm:ss'),'mm') )-Min( interval(Time#(Heure,'hh:mm:ss'),'mm') )

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You have not explained what you want and what you got, so I am guessing here. I think that your expression is wrong and in the Interval() statements are in the wrong place. So I can suggest these two options:

= Interval(Sum({$<État={"Disponible"}>} Time#(Durée,'hh:mm:ss')) / (Max(Time#(Heure,'hh:mm:ss')) - Min(Time#(Heure,'hh:mm:ss'))))

= Sum({$<État={"Disponible"}>} Time#(Durée,'hh:mm:ss')) / (Max(Time#(Heure,'hh:mm:ss')) - Min(Time#(Heure,'hh:mm:ss'))) * 1440

The first outputs an interval formatted as time in minutes, the second returns a number of minutes (ie as a number)

HTH

Jonathan

Edit: The code assumes that Duree and Heure are strings of the form hh:mm:ss. If they are actually times, then the Time#() statements are not required.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thank you but it does not work. In fact I want to transform my fields Duration and Time in minutes and as such it will be more simple calculation. I want to calculate the rate of availability of an agent in a call center. I have a start time, end time and som times of availability ....!