Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324918

Summary: X Series Grouping as DateTime erroneously summing when should be using Last
Product: z_Archived Reporter: Mark Victory <mvictory>
Component: BIRTAssignee: Birt-Chart-inbox <Birt-Chart-inbox>
Status: REOPENED --- QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Mark Victory CLA 2010-09-09 21:09:58 EDT
Build Identifier: v20100210-0630

My chart displays values over some amount of Days.

The value for each day is already a Sum. That is the "Value (Y) Series" Aggregation Expression is set to "Sum".

The Grouping for the Category (X) Series is set to be type DateTime. The Aggregate Expression is set to "Last".

If the unit for the Grouping of the X Series is Days, the data displays correctly.

If, however, the grouping is something else - Weeks or Months for example, the result is a Sum of the values in the Week or Month. Since I set the Aggregate Expression of the X Series to be "Last" I expected it to show the value from the "Last" day of the Week or Month.

Note that there are other Y Series whose Aggregation Function is set to "Default(Last).  The data for those series appear correctly when the grouping is Weeks or Months.  It is only the Y Series whose Aggregation Function is SUM that display incorrectly.

Reproducible: Always
Comment 1 Xiaoying Gu CLA 2010-09-10 03:30:46 EDT
(In reply to comment #0)
> Build Identifier: v20100210-0630
> 
> My chart displays values over some amount of Days.
> 
> The value for each day is already a Sum. That is the "Value (Y) Series"
> Aggregation Expression is set to "Sum".
> 
> The Grouping for the Category (X) Series is set to be type DateTime. The
> Aggregate Expression is set to "Last".
> 
> If the unit for the Grouping of the X Series is Days, the data displays
> correctly.
> 
> If, however, the grouping is something else - Weeks or Months for example, the
> result is a Sum of the values in the Week or Month. Since I set the Aggregate
> Expression of the X Series to be "Last" I expected it to show the value from
> the "Last" day of the Week or Month.
> 
> Note that there are other Y Series whose Aggregation Function is set to
> "Default(Last).  The data for those series appear correctly when the grouping
> is Weeks or Months.  It is only the Y Series whose Aggregation Function is SUM
> that display incorrectly.
> 
> Reproducible: Always

Hi there,

Could you please attach the report design that using sample db to reproduce this issue?
Comment 2 Mark Victory CLA 2010-09-16 11:21:36 EDT
Hi,

I don't have the sample db set up.
Would it be any help to attach my report design along with some screen shots of the results?
Comment 3 Mark Victory CLA 2010-09-16 15:04:14 EDT
Another note.
I thought that perhaps this was behaving as it should since I picked a grouping unit of Weeks or Months so instead I tried leaving the grouping unit as Days and changing the Interval to 7 or 30 and the results are the same.  The Y Series' whose aggregate expression is Sum would sum over the X dimension even if the X dimension's Aggregate Expression is set to be "Last"
Comment 4 Maggie Shen CLA 2010-09-17 02:51:52 EDT
Aggregation on Y series will override that on X series. This is expected behavior.
Comment 5 Mark Victory CLA 2010-09-22 13:29:30 EDT
It was suggested to me by folks on the BIRT forum that this be made an enhancement request as there seems to be no way to do what I need and it doesn't seem all that unusual.

The dataset I have contains multiple rows of data per day.  I need to sum a column in the data set to get the totals for each day.  That works great.

What I can't seem to do is tell the chart to use the last day of the week or month as the value when the x-grouping is by Week or Month.  Rather it always sums all the days of the Week or Month(apparently because the y series aggregation is to Sum (which I need to get the totals for each day).

Is it unusual to want to sum data to get totals for a day but have the value for the last day of the week be the total for the week?

Does it make sense that this be made an enhancement request?