Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Column sum based on another column
Column sum based on another column [message #770678] Sat, 24 December 2011 20:52 Go to next message
Nagabhushan Bhushan is currently offline Nagabhushan Bhushan
Messages: 2
Registered: December 2011
Junior Member
Hi,

I'm new to BIRT and am trying to create a balance sheet report which contains amount column and DB/CR column.
I need to calculate sum of Amount column based on DB/CR. i.e., i need to ADD the amount value if DB/CR column has DB and subtract amount value if DB/CR has CR.
the total has to be displayed at the end of the amount column.
Please help how to calculate the same
Re: Column sum based on another column [message #771600 is a reply to message #770678] Tue, 27 December 2011 13:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

How do your DB/CR values come in? As positive and negative values?
Can you post a sample of what the data could look like?

Jason

On 12/24/2011 8:52 PM, Nagabhushan Bhushan wrote:
> Hi,
>
> I'm new to BIRT and am trying to create a balance sheet report which contains amount column and DB/CR column.
> I need to calculate sum of Amount column based on DB/CR. i.e., i need to ADD the amount value if DB/CR column has DB and subtract amount value if DB/CR has CR.
> the total has to be displayed at the end of the amount column.
> Please help how to calculate the same
>
Re: Column sum based on another column [message #771655 is a reply to message #771600] Tue, 27 December 2011 16:09 Go to previous messageGo to next message
Nagabhushan Bhushan is currently offline Nagabhushan Bhushan
Messages: 2
Registered: December 2011
Junior Member
I've attached the sample of how the report should look like. I need to get the value of TOTAL that is calculated in the sample data.
The table is grouped based on the GLType and Ledger number and for each group of gltype, i need to display the total.
  • Attachment: Book1.xlsx
    (Size: 10.14KB, Downloaded 91 times)
Re: Column sum based on another column [message #772433 is a reply to message #771655] Thu, 29 December 2011 14:24 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I am not sure how you calculate your balance, but I dumped your data to
csv file and wrote a report off of it. If you look at the expression on
the aggregation element in the group footer you will see how I handle
the db vs cr field.

if(dataSetRow["DB / CR"] == "db"){
dataSetRow["Balance"];
}else{
dataSetRow["Balance"]*-1;
}

Jason

n 12/27/2011 4:09 PM, Nagabhushan Bhushan wrote:
> I've attached the sample of how the report should look like. I need to get the value of TOTAL that is calculated in the sample data.
> The table is grouped based on the GLType and Ledger number and for each group of gltype, i need to display the total.
Previous Topic:Report parameters not retaining default value
Next Topic:How to calculate SUM cumulative times type of string?
Goto Forum:
  


Current Time: Sat Aug 23 03:34:09 EDT 2014

Powered by FUDForum. Page generated in 0.01648 seconds