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)
Column sum birt report
prashu_444
hi,
I have column in table with float values.I want sum value for all the cells except for the first cell. For example I have column c1
c1
1
2
3
4
I want sum as 9(skipping first value).
is it possible ..........??? how ???
Thanks
Prashanth.J
Find more posts tagged with
Comments
mwilliams
Hi Prashanth.J,
There are several ways to go about doing that. I will list a couple ideas.
1)
In your initialize script, do the following:
total = null;
In the onCreate script for the c1 data item, put the following:
if (total == null){
total = 0;
}
else{
total = total + row["c1"];
}
Then, in a type float data item in your footer, put the following:
total + row["c1"];
You do the + row["c1"] because BIRT seems to not add the last value for some reason before the footer data item is created.
2)
Another way would be to create a type float computed column that is the SUM of your column 'c1', called 'Sum_c1'. Then, in your initialize script, put the following:
first = null;
Then in your c1 data item's onCreate script, put:
if (first == null){
first = row["c1"];
}
Then in a type float data item in your footer you would put:
row["Sum_c1"] - first;
Either of these should do it for you. Let me know if you run into any troubles.