Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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 Friend
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 WeathersbyFriend
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 Friend
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 messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
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.
>
>
Re: Calculate Cumulative value in cross tab [message #1800548 is a reply to message #709164] Wed, 02 January 2019 08:44 Go to previous message
Siew Yin Pang is currently offline Siew Yin PangFriend
Messages: 4
Registered: January 2019
Junior Member
I also getting the NaN on every column. My data type is Integer and using Version: Kepler Service Release 1
Previous Topic:DataException: The new column name or alias...
Next Topic:org.eclipse.birt.report.engine.api.EngineException: Can not convert the value of 17-12-2018 to java.
Goto Forum:
  


Current Time: Fri Apr 19 07:40:31 GMT 2024

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

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

Back to the top