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
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
...
# 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
...