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

Crystal Formula Grand Total - Running total 1

Status
Not open for further replies.

jlr123

Technical User
Feb 24, 2014
117
0
16
US
I have this formula in a report which I need a Grand Total
DistinctCount ({AR_Customer.CustomerNo}, {AR_Customer.SalespersonNo}) - {#CustomerCountNoYTDSales} (this last part is a running total formula: Sum ({@YTD}, {AR_Customer.CustomerNo})=0

What I am trying to get is a Grand Total of Distinct CustomerNo minus Distinct CustomerNo which have No YTD sales (which will be number of Revenue Customers)

Hopefully, you can assist me. Thanks!
 
You will need to use a variable to achieve this. As long as the {AR_Customer.SalespersonNo} Group level results are working, something like this should work:

Place the following fomula in the Group Footer for the group on {AR_Customer.SalespersonNo}:

[Code {@Calculate}]
WhilePrintingRecords;

Global NumberVar AllCust;
Global NumberVar NoSale;

AllCust := AllCust + DistinctCount({AR_Customer.CustomerNo}, {AR_Customer.SalespersonNo});

NoSale := NoSale + {#CustomerCountNoYTDSales};

''
[/Code]

In the Report Footer Place the following Formula:

[Code {@Result}]
WhilePrintingRecords;

Global NumberVar AllCust;
Global NumberVar NoSale;

AllCust - NoSale
[/Code]

Hope this helps.

Cheers
Pete.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top