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!

Crystal 9- Subtotal on a "Distinct Count" of a FORMULA?

Status
Not open for further replies.

OrionStar

Technical User
Dec 3, 2004
336
US
I need to do a subtotal on a distinct count OF A FORMULA FIELD.

Can it be done and if so, HOW?

Thanks
Mike

"A man is only as happy,... as he makes up his mind to be...
 
Hello happy Mike. The only way to add up stuff that Crystal doesn't want to add through "summaries" is to use formulas that create variables and then add whatever you need to the variables yourself. If you're an experienced programmer, you can take it from there using the Crystal help system. If not, you might find this very difficult. But it's the only way.
 
Thank you for your input, Uh you forget the HOW part of the question? Just kidding. Here is my formula and I've got a DISTINCT COUNT summary based on the result of this formual.


If{C1_A_R_FeeTsk.Fee_Activity_Code_Relieved}= "FBE" then "WTSale"
Else IF{C1_A_R_FeeTsk.Fee_Activity_Code_Relieved}= "FBD" then "WTSale"
Else If{C1_A_R_FeeTsk.Fee_Activity_Code_Relieved}= "HEI" then "WTSale"
Else "Closed"

My data by INVOICE will list either "WTSale" OR "Closed"

My DISTINCT COUNT summary gives me a "1" or a "2" as my data will either have ALL "CLOSED" or some mixed with "Closed" and "WTSale".

Ok, so I'd like to ADD UP the TOTAL number of "1's" and the TOTAL number of "2's"

I'm hoping to get an example of a formula to use.
Any help is appreciated.




"A man is only as happy,... as he makes up his mind to be...
 
If you are looking for a grand total then create these formulas:

//{@accum} to be placed in the group header or footer:
whileprintingrecords;
numbervar sumcnt := sumcnt + distinctcount({@yourformula},{table.groupfield});

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar sumcnt;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top