Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Summing the value of a column from mutiple rows
Birt_newbi
Hi,
I am trying to sum up the values of a numeric field from a subquery that is union. The subquery actually produces 2 data rows, that looks like this
row 1 = A , 30
row 2 = B, 50
I have bound this subquery to a table . I need to display the total value of
(30 + 50) in one line. I am able to calculate the total value, but my problem is that this value is displaying twice when I do use the dynamic text report item to display the value of the report body.
I see this
80
80
It is asif the summation is being displayed for each data row. Could you please help?
Thank you.
Find more posts tagged with
Comments
Birt_newbi
Isn't there a simple BIRT equivalent for <br />
For(i=0; i<total_count; i++)<br />
{<br />
total_sum = total_sum + row
.amt<br />
}<br />
<br />
look the construct that I have used.<br />
<br />
sum = 0;<br />
<br />
for (count = 0; count < Total.count(); count++){<br />
num = row["NVL(SUM(T.DLLR_AM),0)"];<br />
sum+= parseInt(num);<br />
}<br />
<br />
Is there a way to force the row to point to next row in a given dataset ?
Virgil Dodson
Hi birt_newbi,
Where in the report are you doing all this summing? You should be able to add an Aggregration in your table header, footer, or group level without resorting to script. and then just hide or delete the detail rows.
I'm moving this thread to the Designing BIRT Reports forum.
Bsupport
Hi,<br />
<br />
Display this Total value at the footer of the table so that you will get it as 80 only once.<br />
<br />
<br />
BirtSupport<br />
<a class='bbc_url' href='
http://www.reportinghouse.com'>Reporting
House: Our Focus...Your Reports</a>