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!

Dividing Two formulas for Avg

Status
Not open for further replies.

jlr123

Technical User
Feb 24, 2014
117
US
Need Average Sale Amount of each customer by Salesperson:
This is my YYD Summary for each salesperson
if {AR_CustomerSalesHistory.FiscalYear} = {?Fiscal Year} and {AR_CustomerSalesHistory.FiscalPeriod} in {?Fiscal Period} then {AR_CustomerSalesHistory.DollarsSold} else 0
This is number of Accounts with Sales
DistinctCount ({AR_Customer.CustomerNo}, {AR_Customer.SalespersonNo}) - {#CustomerCountNoYTDSales}

Thanks for your assistance.
 
How is your running total set up exactly?

-LB
 
Only one Running Total of No YTD Sales:
Field to Summarize: AR_Customer. Customer No
Type of Summary: distinct Count
Formula: Sum ({@YTD}, {AR_Customer.CustomerNo})=0
On change of Group: Group #1 Ar_Customer.Salesperson
jlr123
 
Instead of using the running total, do this.

First, make a formula {@null} by creating a new formula that contains nothing and saving it. Then create a second formula:


//{@CustYTD>0}:
if {@YTD} > 0 then
{AR_Customer.CustomerNo} else
{@null}

Then use the following for your summary:

Distinctcount({@CustYTD>0},{AR_Customer.SalespersonNo})

-LB
 
I don't see the average sale formula.
jlr123
 
Sum({@YTD},{AR_Customer.SalesPersonNo}/distinctcount({@CustYD>0},{AR_Customer.SalespersonNo}

-LB
 
ok, I am having a problem. What is the @null formula please?
 
There is NOTHING in the formula. Open the formula the way you would to create a new formula. Then save it without entering anything. Name it "Null".

-LB
 
For some reason, Crystal does not like this formula
Distinctcount({@CustYTD>0},{AR_Customer.SalespersonNo})


Crystal pop up says {CustYTD>0} field not known.

I named the formula CustYTD and copied and pasted it as you have it in the thread.

When I change the formula to Distinctcount({@CustYTD},{AR_Customer.SalespersonNo})
the result is +1 more than it should be.
 
If you named it CustYTD then use that formula instead of CustYTTD>0.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top