|
Re: Obtaining value from previous row in cube [message #1249567 is a reply to message #1248769] |
Tue, 18 February 2014 11:33 |
donino donino Messages: 183 Registered: July 2011 |
Senior Member |
|
|
This might drive you to a complex report, hard to develop and to maintain. You would probably better solve this issue within the relevant dataset, rather than during the render of the chart. Something like this (obviously the dataset should be sorted by month & hour in month):
In "initialize" event of the report, we can declare a global variable such:
lastHourMonthValue=0; //don't set "var" to declare a global variable
In the dataset, create a computed column to represent the corrected value. In the expression, something like:
if (<myConditionToDetectLastHourOfMonth>){
var previousValue = lastHourMonthValue; //this time we declare a local variable
lastHourMonthValue=row["myColumnHourValue"];//we update our global variable
(row["myColumnHourValue"]-previousValue); //value actually returned to the computed column
}else{
row["myColumnHourValue"]; //not a last hour in month, so we just return the original column value
}
And last but not least, we can now use this computed column in the datacube instead of the original column.
I hope this helps.
[Updated on: Tue, 18 February 2014 11:34] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04103 seconds