Quantcast
Channel: BIRT Exchange Forum Feed
Viewing all articles
Browse latest Browse all 542

Why does a computed column seem to add values across multiple rows

$
0
0
I have a result set that looks something like:

# Attempted, I_INVOICE_COST
50,2.4828
50,1.4496
50,1.4656
50,1.4664

I create a calculated column like this to avoid division by zero
var totalCost = 0;

if (row["I_INVOICE_COST"] != null) {
	if (row["# Attempted"] != 0) {
		totalCost = row["I_INVOICE_COST"] / row["# Attempted"];
	}
}

totalCost;


and all of the totalCost rows are the same:

# Attempted, I_INVOICE_COST
50,2.4828,6.0253
50,1.4496,6.0253
50,1.4656,6.0253
50,1.4664,6.0253
...

Viewing all articles
Browse latest Browse all 542

Trending Articles