Skip to main content



      Home
Home » Archived » 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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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 320 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
Eclipse UserFriend
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: Wed Jul 23 17:50:25 EDT 2025

Powered by FUDForum. Page generated in 0.06996 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top