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)
Problem with using TopN filter and sorting on aggregated data in table
shahamar
Hi,
It seems there is some problem while using TopN filter along with sorting key on a aggregated column for any grouping creteria of table.
If you use just sorting key on aggregated column data comes as required in sorted order. Once you add TopN filter on any aggregated column sorting gets distrubed.
can any body tell if it is bug in BIRT 2.3 and if so any work arround to the problem.
I am attaching sample report with simple dataset Something like
Destination Port
8080
8081
9090
8080
9090
1200
8888
9090
8888
I wanted to dispaly PORT | COUNT to see ports with Top N count sorted by COUNT descending.
Yes shifting aggregation to column may help but want to know the solution with BIRT Fitler and sorting with aggregation.
Thanks a lot for your support.
Amar
Find more posts tagged with
Comments
mwilliams
Hi Amar,
I don't have 2.3.0 on my computer anymore, but I ran it in 2.3.1 and it seemed to work fine. What are the issues you're seeing? Maybe I'm just not looking at it right. Let me know.
shahamar
Thanks for the reply.
Look at the attached rptdesign file.
1. we have a dataset to return all the port numbers
2. In table need to display ports and their COUNT. So bind dataset with the table. Add group by creteria on port.
3. Now add aggregate column as COUNT on port column.
4. Go back to group by criteria and add sort key as this newly added column binding.
Out put will be sorted by COUNT (ASC/DESC)
Now add Filter to same group by criteria as expression as row["COUNT"], operator Top N and value say 3. This filter should dispalay port with top 3 count. On running report you will get to see the Top 3 records.
But with Top N filter the sorted records are now not coming in sorted order of COUNT. We have both TopN filter and sort by added to group criteria.
Not sure what's the problem. Also not sure of the general order. Does BIRT first filter records and than sort or first sort records and then sort.
mwilliams
Amar,
You already had all that done in the report design attached. Here is the output that I get in 2.3.1. Is this not what you were expecting to get?