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.
EDIT: Added test qvw as attachment
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
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 ! 😉