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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing unique Values to group header

Status
Not open for further replies.

DARKSETH

Technical User
Jun 5, 2012
1
ZA
Hi.

I got the following data in Crystal. Been battling for weeks now. PLEASE HELP .My problem is data I get is like this from the ORACLE VIEW, the FAX orders and Rep_orders has got the same unique value for each stats group.


Detail
Cust Date Stats Fax_orders Rep_orders
1011 Jan-12 500 500 150
1011 Jan-12 310 500 150
1011 Jan-12 410 500 150
1011 Jan-12 800 500 150
1011 Jan-12 200 500 150
1011 Feb-12 500 500 150
1011 Feb-12 310 200 0
1011 Feb-12 800 200 0
1011 Feb-12 200 200 0
1022 Jan-12 500 300 150
1022 Jan-12 410 300 150
1022 Jan-12 800 300 150
1022 Feb-12 500 600 150
1022 Feb-12 310 600 150
1022 Feb-12 410 600 150
1022 Feb-12 800 600 150

My Group totals show

Cust Fax_orders Rep_orders
1011 3600 900
1022 3300 1050

Must Show
Cust Fax_orders Rep_orders
1011 700 150
1022 900 300

 
Since you need this in the group header, you can't use a running total. So, try something like this:

1. Create a formula that looks something like this:

If PreviousIsNull({table.Cust}) or ({table.Cust} <> previous({table.Cust}) and {table.Date} <> previous({table.Date}) then {table.Fax_Orders} else 0

2. Sum this formula.

If this works, repeat it for Rep_Orders.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
I think you will have to use running totals that evaluate on change of date, reset on change of group: cust. Place the running total in the group footer, and then save the report as a subreport, and insert it in the group header of the original report, linked on the cust field. Suppress all sections in the sub except the report footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top