Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Calculate Cumulative value in cross tab(Calculate Cumulative value in cross tab)
Calculate Cumulative value in cross tab [message #708016] Tue, 02 August 2011 10:38 Go to next message
jeyinul  is currently offline jeyinul
Messages: 60
Registered: June 2011
Member
Hi Jason,


I want to generate a report with cumulative.

I am creating the report using Cross tab.

The report is like,

jan || Feb || Mar
1 || 2 || 3

1 is the value of Jan and 2 is the value of Feb and 3 is the value of Mar.

for Jan, the value is same.
For Feb, The report should calculate jan+ Fab

i.e

Jan || Feb || Mar
1||3||6

Plz help me on this.
Re: Calculate Cumulative value in cross tab [message #708253 is a reply to message #708016] Tue, 02 August 2011 15:29 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

On the aggregation element in the crosstab put an oncreate script like:

//This is summing integers, you can also use parseFloat
if( typeof myrunningsum != 'undefined'){
myrunningsum = parseInt(this.getValue()) + parseInt(myrunningsum);
}else{
myrunningsum = parseInt(this.getValue());
}
this.setDisplayValue(myrunningsum);

See attached example

Jason


On 8/2/2011 6:38 AM, jeyinul wrote:
> Hi Jason,
>
>
> I want to generate a report with cumulative.
>
> I am creating the report using Cross tab.
>
> The report is like,
>
> jan || Feb || Mar 1 || 2 || 3
>
> 1 is the value of Jan and 2 is the value of Feb and 3 is the value of Mar.
>
> for Jan, the value is same.
> For Feb, The report should calculate jan+ Fab
>
> i.e
>
> Jan || Feb || Mar
> 1||3||6
>
> Plz help me on this.
Re: Calculate Cumulative value in cross tab [message #708702 is a reply to message #708253] Wed, 03 August 2011 05:19 Go to previous messageGo to next message
jeyinul  is currently offline jeyinul
Messages: 60
Registered: June 2011
Member
Its not working Jason,

I am getting like NaN in each column.

Re: Calculate Cumulative value in cross tab [message #709164 is a reply to message #708702] Wed, 03 August 2011 15:16 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

What is the data type of the element and what version of BIRT are you using.

Jason

On 8/3/2011 1:19 AM, jeyinul wrote:
> Its not working Jason,
>
> I am getting like NaN in each column.
>
>
Previous Topic:(no subject)
Next Topic:Enabling study layout in JavaScript generated axes
Goto Forum:
  


Current Time: Sun Sep 21 14:22:48 GMT 2014

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

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