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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to calculate 24-time difference in qlisense

Hi All,

Below is my script. Ist script  output is correct. Ex: 00:47

2 nd script output is wrong. Ex: 23:13:00 PM

Required out put: 23:13

1st script:

interval(time("To  ", 'hh:mm') - time("From   ", 'hh:mm'), 'hh:mm')as "Outage Duration",

2nd Scropt:

interval(time('24:00', 'hh:mm')-

interval(time("To  ", 'hh:mm') - time("From   ", 'hh:mm'),'hh:mm')) as "Overall Availability"

3rd Script:

((interval(time('24:00', 'hh:mm')-interval(time("To  ", 'hh:mm') - time("From   ", 'hh:mm'), 'hh:mm')))/24)*100 as "Overall Availability"

Qliksense output :

Capture.PNG

Regards,

Krishna

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Can you try this?

Interval(time('24:00', 'hh:mm')- (time("To  ", 'hh:mm') - time("From   ", 'hh:mm')),'hh:mm')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
Anil_Babu_Samineni

Can you try this?

Interval(time('24:00', 'hh:mm')- (time("To  ", 'hh:mm') - time("From   ", 'hh:mm')),'hh:mm')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi Anil,

How to calculate Overall Availability%

Formula: (Overall Availability/24)*100

Below script returns wrong out put.

Script:

((Interval(time('24:00', 'hh:mm')- (time("To  ", 'hh:mm') - time("From   ", 'hh:mm')),'hh:mm'))/24)*100 as AV%

Thanks,

Krishna.

Anil_Babu_Samineni

Instead sharing excel, Please post qvw to look. Again we need to load the data and work.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful