Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Count minutes
BIRTigo
Hi,
If for example i have the following data:
Device || Date || Status
===========================
PC1 || 8/4/2008 11:13 || UP
PC1 || 8/4/2008 11:19 || IDLE
PC1 || 8/4/2008 11:21 || DOWN
PC1 || 8/4/2008 11:22 || IDLE
PC1 || 8/4/2008 11:23 || UP
PC1 || 8/4/2008 11:28 || IDLE
PC1 || 8/4/2008 11:29 || DOWN
I want to compute the interval or how many minutes the device stayed from one status to another or how many minutes from UP to IDLE or from UP to DOWN.
Please help
Find more posts tagged with
Comments
mwilliams
Hi BIRTigo,
Just a couple questions before I try this out.
Are there ever different devices in the same data?(you only show PC1)
What's the longest it could possibly be between status changes? If it could possibly be days, weeks, months, etc...it could make it harder.
Let me know and I'll check it out.
BIRTigo
Hi,
Thank you very much for your response.
I have 2 reports that has the same concept, the difference is just that the first report only ask for 1 parameter which is Device Name and the other report uses 3 parameters which are Device name, Start Date/Time and End Date/Time.
The status change depends, but minimum is 1 minute and maximum is 1 week, if it goes beyond that i think i should put a warning message saying that they should check out the device.
I hope you could help me with this. Thank you so much. :-)
P.S.
I'm using BIRT 2.2 :-D
mwilliams
So, each individual report will only have data from 1 device? No possibility of multiple devices on 1 report?
mwilliams
BIRTigo,
Ok. As long as your "Date" comes in as a format of Date Time, this should work for you.
In the BeforeOpen script section of the dataSet, I put:
i=0;
Then, in the dataSet, I created a computed column called IntervalInMinutes of type Integer and put the following as the expression:
if (i==0){
lastTime = row["DateTime"];
i=1;
0;
}
else{
diff = DateTimeSpan.minutes(lastTime, row["DateTime"]);
lastTime = row["DateTime"];
diff;
}
This gives you the interval of minutes between the status changes, giving a 0 to the first one. You can then go make a computed column that displays warnings if you've gone over a weeks worth of minutes between status changes.
Hope this helps.
BIRTigo
Hi Michael,
It worked! thank you so much!.