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)
Sub and Grand Totals
Frisky
<p>Hi all
I'm a relatively inew user of BIRT and so I'm learning every day. However, I seem to have hit a stumbling block in terms of Sub and Grand totals which wasnt in the training. I'm sure this will be an easy answer....
I have a report that produces an amount in two categories for each establishment for each of the areas I deal with.
It would look similar to the below:
Area Details Amount A Amount B
Area 1 Company 1 12 11
Company 2 10 8
Company 3 4 7
<strong> SUB TOTAL N N </strong>
Area 2 Company 4 4 2
Company 5 15 13
<strong> SUB TOTAL N N</strong>
Area 3 Company 6 15 17
Company 7 19 13
<strong> SUB TOTAL N N</strong>
<strong> GRAND TOTAL N N</strong>
How do I add s SUB TOTAL for each Area (these have been done by using Groups in BIRT) then a GRAND TOTAL at the end?
All other data is pulled from a data source, so nothing is calculated in BIRT. I've tried to look at Data Cubes, but cannot put the correct details in! Must be missing something?
Thanks</p>
Find more posts tagged with
Comments
pricher
<p>Hi Frisky,</p><p> </p><p>The attached example shows how to use a crosstab and a table to accomplish what you need.</p><p> </p><p>In the crosstab, use the Row Area sub total and grand total to display the aggregations.</p><p> </p><p>In the table, create aggregations at the group and table level.</p><p> </p><p> </p><p>Hope this helps,</p><p> </p><p>P.</p>
Frisky
<p>Hi</p><p>Thanks for getting back to me.</p><p>However I get an error message when using the Cross tab..</p><p><span class='bbc_underline'><span style="font-size:12pt;">[color=#FF0000;][font="'times new roman', serif;"]ReportDesign (id = 1): [/color][/font]</span></span></p><p><span style="font-size:12pt;">[color=#FF0000;][font="'times new roman', serif;"]+ An exception occurred during processing. Please see the following message for details:<br />
exception.error<br />
Error happens when create measure.<br />
A BIRT exception occurred. See next exception for more information.<br />
Can not convert the value of to Double type. [/color][/font]</span></p><p> </p><p>Any thoughts?</p><p>Thanks</p>
GLO_FR
<p>Hi,</p><p> </p><p>can you upload your design.</p><p>Are you triing to convert something like a integer or date or whatever in a double ?</p>
Frisky
<p>Hi</p><p>No, not trying to convert anything, just adding figures for each area. Attempted to add an Aggragate builder (which is where the errors arise).</p><p>Have removed the cross tab for now.</p><p> </p><p>Any help would be appreciated, thanks</p>
GLO_FR
<p>Can you also upload an xml sample (for the data).</p><p> </p><p>Did the "new date()" field works (top right) ?</p><p>It's better to use a dynamic tex for that</p>
Frisky
<p>Yeah the date works ok... will change it over if it improves the performance though - cheers</p><p>Sample data attatched</p><p>Thanks</p>
GLO_FR
<p>Are your sure it's the xml used in this report ?</p><p> </p><p>I think I found what is wrong.</p><p>first, if you run the uploaded report, does it works ? If no, delete the data cube and try again.</p>
Frisky
<p>I had to remove a lot of the data and create a new xml (sensitive reasons)</p><p>I guess its down to not understanding how the cube works with the data I have and of course no-one can show me. So I'm a little stuck, really</p>
GLO_FR
<p>In your cube, you're triing to create "sum" measure with string.</p><p>In your report, you're doing also agregation with string (sum(local place) or avg(local_place))</p><p> </p><p>You can do a count/min/max with a string field but that all. If you want to have a sum, change local_place to a numeric value and it should works</p>
Frisky
<p>Hi - Sorted; thanks! It hadn't occurred to me to check the the data type in the Data Set - Doh! Every day is a school day!</p><p>Didnt need a Cross tab or data Cube in the end...</p>
GLO_FR
<p>Cool.</p>