[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Re: How to calculate difference between current and previous row?

Tobias,

To get the previous value you could create a computed column to do this.

First in the dataset beforeOpen script add a JavaScript variable like this:

prevVal = 0;

Then add a computed column like this:
var tPrevVal = prevVal;
prevVal = row["thecolumniwantthepreviousvaluefrom"];
tPrevVal;

The only value that will really  not be valid is the first.

Jason



Tobias Mayer wrote:
Hi,

ich have a CSV-File containing one column with Date values. Now i need to somehow create another column containing the difference of days between the current row and the previous one. I found out how i could calculate this difference, but i don't know how i can access the data of the previous row. Any suggestions/solution?

TIA
Tobias Mayer