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)
Getting total and Grand Total by creating Groups
Chanda
Hi,<br />
<br />
I have designed report which shows below O/p.<br />
<br />
Br/subscriber Total Sub1 sub2 sub3 Sub4<br />
D&B Prod1 10 2 2 6 0<br />
D&B Prod2 100 0 20 0 80<br />
D&B Prod3 600 100 200 300 0 <br />
<strong class='bbc'>D&B Total 710</strong><br />
<br />
Asian Prod1 11 5 6 0 0 <br />
Asian Prod2 56 25 30 0 1 <br />
<strong class='bbc'>Asian Total 67</strong><br />
<br />
Cortera Prod1 63 25 50 3 5 <br />
Cortera Prod2 131 100 30 0 1 <br />
<strong class='bbc'>Cortera Total 184</strong><br />
<br />
I am able to achieve this O/P correctly by using Group on Br/Subscriber, but I need grand total of all Br/Subscriber, i.e D&B Total +Asian Total +Cortera Total which is 961. at the end of report. Please advice how to do.<br />
<br />
Thanks in advance.<br />
Chanda
Find more posts tagged with
Comments
mwilliams
Hi Chanda,
You should be able to put an aggregation in the table footer just like you were able to use an aggregation in the group footer for the group totals. You'd just sum the value over the table rather than the group. Let me know if you have any questions.
Chanda
Thanks for your replay.
I tried this, it is working fine. Thanks.
Chanda
Hi,
Attached report has two nested tables customer and order. For every customernumber second table query order will be executed. I created group on customernumber, and added Agg at group footer to get count of orders for each Customer number. Till here it is fine.
Now I want to get Grand total of orders at the end of report. Which is equal to sum of orders of every customernumber. Please advice. I have attached my report. Please help.
mwilliams
Chanda,
Check out the modifications I made to your design. I created a variable in the initialize method, incremented it in the aggregation script for each embedded table. Then, reported it in the footer of the outer table. Hope this helps. Let me know if you have questions.
Chanda
Thanks Michael.
I was trying this but I did not haD idea of initializing variable at the Report level. So I was getting Error as "Variable Not Defined". Still I need to learn more.
Thanks for your solution.
Regards,
Chanda
mwilliams
Chanda,
You also have use of PersistentGlobalVariables if the regular variable doesn't work for your situation.
Chanda
Thanks, regular variables are working fine.
Regards,
Chanda
Chanda
Hi,
Now I need sum of price at Account number as well as AT the end of report (table footer level) for every please advice how I can achieve.
Ex:
ORDERNUMBER ORDERDATE REQUIREDDATE SHIPPEDDATE STATUS price CUSTOMERNUMBER
10120 29-Apr-03 8-May-03 1-May-03 Shipped 30 114
10125 21-May-03 27-May-03 24-May-03 Shipped 50 114
10223 20-Feb-04 29-Feb-04 24-Feb-04 Shipped 80 114
10342 24-Nov-04 1-Dec-04 29-Nov-04 Shipped 100 114
Total 260
ORDERNUMBER ORDERDATE REQUIREDDATE SHIPPEDDATE STATUS price CUSTOMERNUMBER
10120 29-Apr-03 8-May-03 1-May-03 Shipped 60 114
10125 21-May-03 27-May-03 24-May-03 Shipped 20 114
10223 20-Feb-04 29-Feb-04 24-Feb-04 Shipped 85 114
10342 24-Nov-04 1-Dec-04 29-Nov-04 Shipped 105 114
Total 270
Grand Total 530
I am able to get total number of orders per Account number by using aggr on row._outer["CUSTOMERNUMBER"]. But now sum of price is in the inner table not in the outer table. I tried by using Global variables but it is not working.
It is always returning first value. that is grand total will be 260. not 530.
Report does not have groups it is just nested table concept. I have attached rptdesigh, but here price column is not there, I have just tried to replicate my issue.
Regards,
chanda
mwilliams
So, what is the issue with the sample you provided? What am I looking at? Just the error? If so, the PGV is set wrong. The variable name has to be a string "ag", and the value has to either be an object or a string. Let me know if there's more question!
Chanda
Hi,
I need O/P as in the attached excel file. I am able to get sum at the account Level, but at the grand total I am not able to.
For time being as there is no price column I have hard coded value as 600, I have tried to replicate issue with model database.
Please advice.
Regards,
Chanda
mwilliams
Total # of orders was correct. for the Average order #, I just used a regular variable and added all of the order numbers together and then did the division in the binding in the footer with the two values we had. This doesn't use a PGV, but in this case, we don't need to use a PGV. Am I missing something, or is this what you wanted?
Chanda
Hi,
I tried same way as above created regular Variable and added all the Approved Amount. And used that variable in Parent table footer. But still I am not able to get correct results.
Grand total is coming as "8166006975.4" instead of "12,249,010,461.10".
"8166006975.4" is a total for "total for Acc NoEC1412466".
I have attached both O/P and rptdesign file. Please advice if I am missing anything.
Regards,
chanda
mwilliams
Is the last embedded table's total just missing from the overall total? Is that what's happening? Does the dynamic textbox that I added help. It seems to be set up correctly to work, the variable may just not be updated in time for the data element. Let me know.
Chanda
Hi,
Thanks, last total from the embedded table was just missing from the Grand total. By adding Dynamic text instead of "Data Element" it is working fine now.
Regards,
Chanda
mwilliams
Good to hear. Let us know whenever you have questions!