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!

V10 My running total field not avail to SUM

Status
Not open for further replies.

mabis

Technical User
Jul 22, 2006
25
US
Running Crystal Reports v10

Goal: Count new accounts sold in current year vs. prior year by comparing current YTD sales greater than 0 against all of prior year sales.

Problem: I have created a formula to evaluate current YTD and prior year sales to give me a 1 for any account that ordered in 2006 but not 2005 and 0 for any account with sales in both years. When I try to add my summary, the field is not available to sum.

The summary I am looking for will be placed on the user level.

Groups:
G1: User
G2: Account (client)
G3: Order
D: Lines and totals within the order

Formulas:
Prior Year Sales: (G2) Sum of @ prioryearsales

Current Year Sales: (G2) Sum of @yeartodatelinetotal

Zero or One for new accounts (@newacctcount):
if Sum ({@prioryearsales}, {account.account_name})<=0
and Sum ({@yeartodatelinetotal}, {account.account_name})> 0
then tonumber(1) else tonumber(0)

Want to sum the zero or ones to give a total count of new clients.


 
You don't really need to approach it this way. If you don't use a select on the date field in the record selection formula, you can then go to report->selection formula->GROUP and enter:

minimum({table.salesdate},{table.account}) >= date(year(currentdate),1,1)

Then use a running total that does a distinctcount of {table.account}, evaluate on change of group {table.account}, reset never. Place this in the report footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top