Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of Time Intervals for Multiple Events

I'm very new to QlickView and trying (using the Personal Edition) to sum the total outage time for multiple network devices from the following table extract:

Event TimeLocationEvent
01/09/2011 15:07ABERDEENNode Down
01/09/2011 15:13ABERDEENNode Up
02/09/2011 08:12ABBEY_WONode Down
02/09/2011 08:27ABBEY_WONode Up
02/09/2011 10:13ABBEY_WONode Down
02/09/2011 10:44ABBEY_WONode Up
09/09/2011 08:09ABERDEENNode Down
09/09/2011 08:48ABERDEENNode Up

I want to calculate the time interval between each matching Node Down -> Node Up event pair and sum for each location to produce the following output:

Location
Total Outage Duration
ABERDEEN00:45:19
ABBEY_WO00:45:07

Can anyone suggest how this can be achieved?

Thanks in advance,

Rich.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Rich,

try if this is correct for you.

if you have problem to open file cause license this is the script:

tab:

LOAD [Event Time],

     Location,

     Event

FROM

.\Cartel1.xls

(biff, embedded labels, table is Foglio1$);

tab1:

load *,if (Peek(Location,-1)=Location and Peek(Event,-1)='Node Down',

          interval([Event Time]-peek([Event Time],-1)),0) as Outage

Resident tab

order by Location,[Event Time],Event

;

DROP Table tab;

I've made a pivot with

Dimension: Location

Expression: time(sum(Outage))

Stefano

View solution in original post

2 Replies
Not applicable
Author

Hi Rich,

try if this is correct for you.

if you have problem to open file cause license this is the script:

tab:

LOAD [Event Time],

     Location,

     Event

FROM

.\Cartel1.xls

(biff, embedded labels, table is Foglio1$);

tab1:

load *,if (Peek(Location,-1)=Location and Peek(Event,-1)='Node Down',

          interval([Event Time]-peek([Event Time],-1)),0) as Outage

Resident tab

order by Location,[Event Time],Event

;

DROP Table tab;

I've made a pivot with

Dimension: Location

Expression: time(sum(Outage))

Stefano

Not applicable
Author

It works perfectly ste.san. Much appreciated. Rich