Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to filter using aggregate funtion
ninkibah
I want to display a subtotal footer row in a group, only if the group has 2 or more rows.
However, when I try adding a filter expression of: Total.count(null, "My Group") I get told:
org.eclipse.birt.report.engine.api.EngineException: Invalid Javascript expression: Total.count(null, "My Group") > 1.
Aggregate function call is not expected in this expression.
Can anybody suggest a workaround?
Find more posts tagged with
Comments
Tianli
Please see attached report, I suggest you to use Aggregation builder instead of Total expression. Total.count(null, "My Group") is considered as a invalid expression and Total.count(true, "My Group") can work.
ninkibah
Tianli,<br />
sadly your example just shows using the Aggregate. I want to filter out the aggregate when I only have a single row in my group. BIRT checks that the filter expression does not contain aggregate expressions (e.g. Total.count) at the same level.<br />
<br />
I am now considering getting the group object, and setting a field to zero on the group header, and then for each group detail row, I increment the count. Then I can check this count in the group footer.<br />
<br />
I got these ideas from reading these BIRT docs: <a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/ref/'>BIRT
Technical Reference</a><br />
But I think this is quite old documentation, so it may not be valid.
ninkibah
I finally found a solution. I set the visibility of the cell based on the expression. This works fine for me. I could not find a way to filter based on an aggregate expression.
I also tried hiding the complete row, and leaving the cells alone, but that didn't work.