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

Trying to get "Distinct count" to ignore a blank value

Status
Not open for further replies.

ramc2000

Technical User
Nov 8, 2002
60
GT
Hello everyone, I'm having problems with the distinct count summary function.

I'm doing a manual crosstab report (CR 8.0), one of the things I want to accomplish is to count the number of orders according to a difference in their types (ie: urgent, normal). The formula I use is:

//DistinctCountUrgents
if {order_type}="urgent"
then
{order_number}
else
""

the problem is that my distinct count summary will always add the blank as if it was an additional order, resulting in a miscalculation for the summary (always 1 more than it should be).

Does anyone know how can I get CR to ignore this blank value? thank you.
 
If you can group by order_n,
create the following formula:
----------------------------
if {order_type}="urgent" then 1 else 0
----------------------------

Then, create a Running Total that sums (note: not count)
that formula and evaluates once for each order_n group.

hth,
- Ido


CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thank you IdoMillet,
I could do grouping by order number, the problem tough, is that I do need a distinct count summary. With your suggestion above, I'd be doing a count of my orders, not a distinct count. Do you know of any other way?? thanks.
 
The Running Total EVALUATE option would take care of that.
You would set it to evaluate for each Order_ID...

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
You're absolutely right! I tried it and now it's working. Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top