Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Best practices to compute a rate from absolute data
Best practices to compute a rate from absolute data [message #651582] Mon, 31 January 2011 17:50 Go to next message
Mike Wulkan is currently offline Mike WulkanFriend
Messages: 147
Registered: July 2009
Senior Member

I'm looking for some best practices advice.

I have a database that has many columns containing absolute counts. The database also has an interval column that indicates how many seconds elapsed for that rows count delta.

I would like to plot these columns as rates (ie., r2-r1/interval2).

To do this I have added a computed column to the dataset as follows:

if (lastSentInsertSuccess == -1) lastSentInsertSuccess = row["NumInsertsSentSuccess"];
var tempInsert = lastSentInsertSuccess;
lastSentInsertSuccess = row["NumInsertsSentSuccess"];
(row["NumInsertsSentSuccess"]-tempInsert)/row["Interval (secs)"];

This works but it is cumbersome as I need to do this for almost every column in the database. This also requires that I initialize the independent lastxxx variables for each column.

1) Is there a function already hidden in BIRT somewhere that will calculate the difference between adjacent rows?

2) Should I be doing this at the dataset level or should I be doing this in the chart?

Re: Best practices to compute a rate from absolute data [message #651608 is a reply to message #651582] Mon, 31 January 2011 21:10 Go to previous message
Richard A. Polunsky is currently offline Richard A. PolunskyFriend
Messages: 212
Registered: July 2009
Location: Houston TX
Senior Member

Most built-in database operators work on the current row only. The usage you're describing is going to be cumbersome regardless of your choice of database and reporting system.

That said, you want to compute your numbers before you hand off to the chart engine. The approach you describe looks like it will work (I do very little charting, so cannot speak to issues coming from that aspect). Depending on how many columns you are working with and the size of the back-end dataset, you may have better performance using a self-join in order to compute the ratios from the database server rather than inside the BIRT application.

Good luck.
Previous Topic:Attempting to change GroupingInterval in a script
Next Topic:Multiple charts on single report - data-driven?
Goto Forum:

Current Time: Wed Jun 20 07:50:20 GMT 2018

Powered by FUDForum. Page generated in 0.01665 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top