Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtotal value of group B and put in th Group A Header

Status
Not open for further replies.

fredong

IS-IT--Management
Sep 19, 2001
332
US
I have a Subtotal that is Group by A Group A header and I need the value of Subtotal Group by B and place the value in the Group A header. Is that possible? Please advise. Thanks. BTW I am using Crystal v.8
 
Could you explain a bit more? Are these two levels of group? Or two successive groups?

A consistent rule in Crystal is that you can't pass data 'upstream'. Dodges are possible, like subreports that collect necessary data, though subrepoirts eat up a lot of machine time.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
for example ,I have a subtotal Group by Customer and Customer BB can have multiple invoices(the second is Group by invoices) like has 3 invoices with the same invoice# 1111 with a subtotal of $150 and another 2 invoices with the same invoice# 2222 with the subtotal of $200. There the subtotal for a Customer BB is $350 and I like the report to look this way in the group by Customer

Customer subtotalCustomer Invoice# InvoiceSubtotal
-------- ---------------- ------ ---------------
BB $350 1111 $150
BB $350 2222 $200



is that possible?Thanks for your help
 
Looks like you want to push the Subtotal from Group A to Group B.

Then try this

Create formula, @subtotalCustomer, place it in Group A header

WhilePrintingRecords;
Shared Numbervar stotal = sum({invoice.amt},{customer.id});

Create formula @displaysubtotal and place it in Group B header

WhilePrintingRecords;
shared numbervar stotal;
stotal

Cheers,
-LW
 
You could just create a formula:

sum({table.invoiceamt},{table.customerid})

...and place this in your group #2 header or footer, i.e., you don't really need to use variables to do this.

-LB

 
Thanks everyone, I will try it and let you all know.
 
I have a problem with my grand total. The distinctcount(id) works fine but when I sum(totalamount), (id), the grand total sums in the duplicate records. How do I fix this?
 
samcneal,

You should have started a new thread. Try using a running total (using the expert) in which you select {table.amount}, sum, evaluate on change of field {table.id}, reset never. This assumes you have sorted by {table.id} or that you have inserted a group on {table.id}.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top