Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

List of incidents

Hello,

Im trying to calculated the up time / downtime of a system.

I have an excel like this.

DateCauseSolutionDownTime (in minuts)Status
25.01.2013Upgrading DBUpgraded DB and restarted system235Unavailable

Every date that doesn't have a record in the list should have 0 downtime, and Up time should be 24*60=1440.

So in January i should have a up time of 31(days)*24(hours)*60(minutes)=44640(100% Up time)-235(downtime)=44405(Actual up time).

Is it possible to add the up time rows dynamically based on the downtime rows? Or do i need to add every date in the list and manually calculated the up time for each day? Please don't hesitate to ask i you require more information or if i am being unclear on my issue.

Best Regards,

Lasse Rolstad

EDIT: Added test qvw as attachment

1 Solution

Accepted Solutions
MVP
MVP

Re: Re: List of incidents

Maybe like attached?

10 Replies
MVP
MVP

Re: List of incidents

You can probably add records in the script to achieve what you want, but since you store only downtime in your records, why not calculate the effective uptime in the front end, like

=count(distinct Date) * 1440 - sum(DownTime)

This just needs a master calender, which I assume you already have.

Not applicable

Re: List of incidents

Henric's blog post will help you.

Please go through following link

http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/05/populating-a-sparsely-populated-field

Karthik

Not applicable

Re: List of incidents

This works, but the dimension is on status, wich now has "Unavailable" and "-". Is there a way to force this to "Uptime"?

abeyphilip
Contributor II

Re: List of incidents

If I understood the reqrmnt correctly, couldn't you add a calculated dimension as -

if(match(status,'Unavailable'), status, 'Uptime')

Regards,

Abey

Not applicable

Re: List of incidents

Dont know why, but now it says 100% uptime all the time. So it dosent seem to work.

abeyphilip
Contributor II

Re: List of incidents

Hi Lasse,

Please post a sample qvw.

Regards,

Abey

cotiso_hanganu
Contributor

Re: List of incidents

Agree both with Karthikeyan S & swuehl

To cut the long story short, you can do the followings:

- dinamically extract in some variables the time interval you need to populate

- use an autogenerate command to create a kind of master calendar table

- afterwards join your data set with this new table

- reread the new created (joined) table populating the empty rows

Alternative solution: applymap might do the job even faster, instead of the last 2 steps (with the use of the defaultexpr option)

Don't forget to enjoy the "disqovery" process ! ;-)

Not applicable

Re: List of incidents

I have posted a sample in the original post.

MVP
MVP

Re: Re: List of incidents

Maybe like attached?

Community Browser