Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
GuillaumeRUE
Contributor III
Contributor III

Calculate % of time in a selected period (or not)

Hello guys,

I would like to calculate the % of time robots are down during a period.

I found the way to calculate the time they are down :

 

=Aggr(sum(Interval(FIN_DEFAUT-DEBUT_DEFAUT)),AGV)

 

But I don't know how to calculate the total time of the period (in seconds should be the best option I think) 

My calendar fields are : Year, Month, Week, Day and Date (the id in format DD/MM/YYYY).

So my goal is to make a table like this for example (here one specific date is selected, so 24 hours) : 

RobotTime down% of period
112:00:0050.00%

 

Thank you,

Guillaume

1 Solution

Accepted Solutions
GuillaumeRUE
Contributor III
Contributor III
Author

Hello guys,

Thank you for your answers.

I found an easy way to do what I want : 

((num((max(Date)) -(min(Date)))+1)*86400)

I was looking for something too difficult .

So with this line I have the selected or not Qlikview period in seconds.

Regards,

Guillaume

View solution in original post

3 Replies
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi GuillaumeRUE,

I suspect you want to do this:

  =Interval(Time#([YourDownTimeField], 'HH:MM:SS'), 'ss')/Interval(Time#('24:00:00'), 'HH:MM:SS'), 'ss')

I hope that helps!

Kind regards,

S.T.

qliksus
Specialist II
Specialist II

In one particular day you want to calculate the downtime or the total downtime for that robot irrespective of the date ?? . Assuming you want to calculate irrespective of the date then you can try

timestamp( timestamp#(Max(Endtime)-Min(starttime) ,'DD/MM/YYY HH:MM:SS') ,'HH:MM:SS')
GuillaumeRUE
Contributor III
Contributor III
Author

Hello guys,

Thank you for your answers.

I found an easy way to do what I want : 

((num((max(Date)) -(min(Date)))+1)*86400)

I was looking for something too difficult .

So with this line I have the selected or not Qlikview period in seconds.

Regards,

Guillaume