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

Conditional Summing using formulas in Running Totals 1

Status
Not open for further replies.

amrnewman

Technical User
Dec 9, 2004
33
GB
Hi

Have not been using Crystal for 2 plus years, so seem to have forgotten a lot!

I have inherited a report that details the discounts applied to sales orders in grouped by order source e.g. Mail, telephone, Web

CR 8.5

I have 4 groups:

Grp 1: Order Source (suppressed)
Grp 2: Discount Code (suppressed)
Grp 3: Order Date (suppressed)
Grp 4: Sales Order Number (header suppressed, footer visible)
Nothing in details

Report looks like this:

Sales Order # Gross Net Total Discount
Order Order Disc Value
Order
Order Source: Mail
5% Discount
123 10.00 7.50 9.50 0.50
etc
etc
etc

Total Disc Count All sums as running totals, summing
order value at group 4 and
resetting at group 2

I then have grand totals in the report footer which are running totals and all this works fine. I have also put averages in the report footer which details the number of %% discounts by mail, telephone, web, 10% discounts by mail, telephone, web etc etc.

I want to insert a total of the discounted order value per order source and discount amount as a grand total in the footer – I have tried a running total evaluating order_value with the formula

{SALES_HEADER.SALES_OFFICE}="MAIL" and {ADDITIONAL_CHARGE.CHARGE_CODE}="XDISC5"

and not resetting, but this is summing the order value for each line item on an order. Any idea how I can conditionally sum the order value as per group 4 with the conditions required for each occurrence.

Hope this is clear since it is a very long time since I have had to try and explain a crystal report!!!

Thanks for your help

A
 
If you are evaluating on change of group #4 in your group level running total, then use the following evaluation formula for your report level running total:

{SALES_HEADER.SALES_OFFICE}="MAIL" and {ADDITIONAL_CHARGE.CHARGE_CODE}="XDISC5" and
{table.salesorderno} <> previous({table.salesorder})

This would evaluate the first record in the sales order number group.

-LB


 
Thanks - this works apart from the first group. Having validated the figures, they all add up apart from the first group - it is not including the first order value in the sum. After that is fine.

Help!

A
 
Sorry, try:

(
onfirstrecord or
{table.salesorderno} <> previous({table.salesorder})
) and
{SALES_HEADER.SALES_OFFICE}="MAIL" and {ADDITIONAL_CHARGE.CHARGE_CODE}="XDISC5"

-LB


 
Thanks so much! Scary to realise I have forgotten even some of the most basic things!!!

This worked perfectly.

A
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top