Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Im trying to calculated the up time / downtime of a system.
I have an excel like this.
Date | Cause | Solution | DownTime (in minuts) | Status |
---|---|---|---|---|
25.01.2013 | Upgrading DB | Upgraded DB and restarted system | 235 | Unavailable |
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
Maybe like attached?
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.
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
This works, but the dimension is on status, wich now has "Unavailable" and "-". Is there a way to force this to "Uptime"?
If I understood the reqrmnt correctly, couldn't you add a calculated dimension as -
if(match(status,'Unavailable'), status, 'Uptime')
Regards,
Abey
Dont know why, but now it says 100% uptime all the time. So it dosent seem to work.
Hi Lasse,
Please post a sample qvw.
Regards,
Abey
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 ! 😉
I have posted a sample in the original post.
Maybe like attached?