Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Why does a computed column seem to add values across multiple rows
edoetsch
I have a result set that looks something like:<br />
<br />
# Attempted, I_INVOICE_COST<br />
50,2.4828<br />
50,1.4496<br />
50,1.4656<br />
50,1.4664<br />
<br />
I create a calculated column like this to avoid division by zero<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var totalCost = 0;
if (row["I_INVOICE_COST"] != null) {
if (row["# Attempted"] != 0) {
totalCost = row["I_INVOICE_COST"] / row["# Attempted"];
}
}
totalCost;
</pre>
and all of the totalCost rows are the same:<br />
<br />
# Attempted, I_INVOICE_COST<br />
50,2.4828,6.0253<br />
50,1.4496,6.0253<br />
50,1.4656,6.0253<br />
50,1.4664,6.0253<br />
...
Find more posts tagged with
Comments
Hans_vd
That shouldn't be.
Are you sure you left the aggregation field empty when creating the computed column?