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

Distinct Count

Status
Not open for further replies.

slickp

Technical User
Feb 15, 2006
35
GB
Can someone explain to me how this function works in crystal

DistinctCount (fld, condfld, cond)

I've looked in crystal help and followed how to use it, but it still won't work. I'm interested in using the "Cond" as a boolean. It keepes saying that you can't use "every Yes" in the "Cond" part on the function cause "A group condition is not allowed here"

Help?
 
condfld" is a very bad name for the 2nd argument. It should be called "GroupBy." If you read the Online help carefully, you would see that it must be a grouping level field/formula.

If you wish to create a conditional total, use a Running Total or create a formula that returns the desired value only when the condition is met (For example, IF {field} = "Yes" Then 1 Else 0) and then total that formula.

- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
The third argument--the "cond" part of the formula--is really only to delimit date groups specified in the 2nd argument (condfld), by using "monthly", "annually", etc.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top