Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Aggregation Count returns "1" when 0 row returned([Birt 4.4.1] Bug or Mistake ?)
Aggregation Count returns "1" when 0 row returned [message #1464457] Fri, 07 November 2014 15:27 Go to next message
Tom G is currently offline Tom GFriend
Messages: 6
Registered: November 2014
Junior Member
hello,

I setup some aggregation for a few tables. Here is what I did :
- select table
- in binding tab click on "Add Aggregation"
- select "COUNT" as function (and INTEGER as datatype)
- Drag and drop a Text item on table footer row
- select HTML and enter <VALUE-OF>row["Aggregation"]</VALUE-OF> Row(s) Returned</B>

This works fine for all tables returning 1 or more rows but for those which should return 0 row I still get a "1 Row(s) Returned" text message.

Did I do something wrong or there is an issue ?
Thanks
Tom

[Updated on: Fri, 07 November 2014 17:15]

Report message to a moderator

Re: Aggregation Count returns "1" when 0 row returned [message #1464605 is a reply to message #1464457] Fri, 07 November 2014 18:33 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

What is your BIRT version?

Michael

Developer Evangelist, Silanis
Re: Aggregation Count returns "1" when 0 row returned [message #1464745 is a reply to message #1464605] Fri, 07 November 2014 21:01 Go to previous messageGo to next message
Tom G is currently offline Tom GFriend
Messages: 6
Registered: November 2014
Junior Member
Version is 4.4.1.
Re: Aggregation Count returns "1" when 0 row returned [message #1468096 is a reply to message #1464745] Mon, 10 November 2014 15:19 Go to previous messageGo to next message
Tom G is currently offline Tom GFriend
Messages: 6
Registered: November 2014
Junior Member
As (hopefully temporary) workaround I managed to hide the Text item when number of rows returned is 0 or 1 with following condition :
row["Aggregation"] < 2
Re: Aggregation Count returns "1" when 0 row returned [message #1468136 is a reply to message #1468096] Mon, 10 November 2014 16:01 Go to previous messageGo to next message
Tom G is currently offline Tom GFriend
Messages: 6
Registered: November 2014
Junior Member
I've made further tests and finally found how to really get "0" when no row is actually returned...
Under Aggregation Builder I have let the Expression field empty.
To get correct number it seems it is needed to put something then I decided to select a column that I'm sure it is filled for each row returned (ie like a primary key for underlying table).
My guess is that when 0 row are returned AGGREGATION COUNT still count for the Table Detail row even if it is empty.
Re: Aggregation Count returns "1" when 0 row returned [message #1469266 is a reply to message #1468136] Tue, 11 November 2014 12:55 Go to previous messageGo to next message
Henning von Bargen is currently offline Henning von BargenFriend
Messages: 23
Registered: May 2011
Junior Member
I stumbled across this, too. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=438257
Re: Aggregation Count returns "1" when 0 row returned [message #1470643 is a reply to message #1469266] Wed, 12 November 2014 13:57 Go to previous messageGo to next message
Tom G is currently offline Tom GFriend
Messages: 6
Registered: November 2014
Junior Member
Thanks for pointing me this.
I voted for it =)
Re: Aggregation Count returns "1" when 0 row returned [message #1471060 is a reply to message #1470643] Wed, 12 November 2014 21:20 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You could also put in a filter expression like this on the aggregation:

dataSetRow["someField"] != null

If there are 0 rows, the value will return as null and 0 will be returned as expected.


Michael

Developer Evangelist, Silanis
Previous Topic:EngineException because of changing position
Next Topic:Upgrading from BIRT 2.6 to BIRT 4.4
Goto Forum:
  


Current Time: Wed Apr 24 23:55:37 GMT 2024

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

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

Back to the top