Hi
Some months ago, I got the following code from this forum to fill empty data from another column (image attached)
//Use this calculation to generate the results
var dataSetColumnWithValues = row["debit_distribue"];
//Change this row["name"] per your value column
if(dataSetColumnWithValues != null){ //Check for value within row
reportContext.setPersistentGlobalVariable("debit_distribue_fill", ""+dataSetColumnWithValues); //Place value in a global variable
dataSetColumnWithValues; //Return value
}else{ //If no value in row
parseFloat(reportContext.getPersistentGlobalVariable("debit_distribue_fill")); //Use exising global variable value
}
But, when there's no data for first rows and the result is not a number (NaN) (image attached), it seem that if I calculate my fill column (ave, sum, etc.), the NaN are replaced but last data of table, like if this code continu to fill beginning of table where there's no data (NaN). Hope it's clear...
Idea the have a real calculation (ave) without this weird 'loop' ?
Martin
