Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Limiting number of records in cube/dataset
Srividya Sharma
Hi
I really love these forums. Great response every time! These forums give me the confidence for cracking any problem related to BIRT. Thank you all.
I am creating BIRT Data Objects so that they can be used across my reports.
Here is my approach, please review if this approach is right in the first place.
1. Create dataset(s) from a table with only a subset of columns and records. This subset is going to be common to all my reports. ( select a few columns with a few common "where" conditions )
2. Then I create a few cubes. Each one groups the data and summarizes it on a different field. ( I added filters too using reusable dynamic report parameter)
3. I use this cube to report data in my design file.
Please tell me if this approach is right.
Now to the actual problem.
I want to limit the number of records in the aggregated data (cube), ( say, LIMIT 5 desc ) using a report parameter.
I have also created a report parameter in my .datadesign file. How do I incorporate this parameter in my cube / report?
Thanks in advance
Srividya
Find more posts tagged with
Comments
mwilliams
Hi Srividya,
From what I'm understanding, it seems you're doing it the right way. As for the question, you have a parameter that brings in a number and you want that number to limit the row dimension values in a crosstab? Is this the case?
Srividya Sharma
Thank you for the review.
Yes, that is right. I want to limit the number of rows based on report parameter.
Srividya Sharma
Please help me with this.
mwilliams
What is your BIRT version? I'll work on a report that limits the crosstab rows based on a parameter in your version.
Srividya Sharma
Hi Michael,
I am using BIRT 2.6.1v2 with BRD Pro 11. I think it is the latest.
Thanks for the help.
mwilliams
Here is a report that I made quickly that hides the element after the nth row. The problem is, the cell still shows, so you'd have to find a way to hide the cell or "mask" it with a border to get rid of the gray section below the table. There are a couple other ways I can think of to do it. One would include ordering your dataSet, stepping through and finding the first n values that would be displayed by either building a comma separated string to use in a crosstab filter or use create a computed column to add as an attribute to your crosstab dimension to use in a filter on your crosstab.
Hope one of these helps.
Srividya Sharma
Thank you Michael.<br />
<br />
I was able to understand the logic behind your example.<br />
<br />
<blockquote class='ipsBlockquote' ><p>create a computed column to add as an attribute to your crosstab dimension to use in a filter on your crosstab.<br /></p></blockquote>
<br />
- this looks like a more effective solution that would work for me, as I am planning to use the data set/cube across reports. <br />
<br />
Can you please elaborate this mechanism a bit?<br />
<br />
Thanks.
mwilliams
You would just order your dataSet by the column your row dimension groups on. You'd then create a computed column to count your groups. You'd have a temp variable defined to track the field of the last row so that you'd know whether to increment or not in your computed column. You'd then build your dataCube like normal only you'd select your row dimension in the dataCube editor and select the "Edit" button. Here you'd add the computed column as an attribute. You'd then create your crosstab like you normally would, but then add a filter that filters out the row if the attribute value is above your limit.
Hope this helps. I'm pretty certain this should work. Let me know if you run into any issues.
Srividya Sharma
Hi,
Thank you for the detailed explanation. I got it working this way!
Thanks,
Srividya Sharma
mwilliams
Great to hear!