×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Summary - Only When ........

Summary - Only When ........

Summary - Only When ........

(OP)
Is it possible to summarise a field only under certain criteria.

I'm trying to use the DistinctCount function to distinctly count (number) records only if they are not equal to zero.

I want to use this ......

DistinctCount ({@NumberValue},{Week})

...... only if {@NumberValue} does not equal "0".

Any help would be much appreciated.

RE: Summary - Only When ........

As long as your version allows it, you can set up a Running Total set to DistinctCount, and evaluate on {@NumberValue} <> 0.

Of course, this is only if NumberValue is the kind of formula which allows for summary activity.

Naith

RE: Summary - Only When ........

(OP)
Thanks for the advice Naith - its version 8 by the way. I will give that a try.

I will post back my outcome on Monday.

RE: Summary - Only When ........

(OP)
Thanks again Naith. Do you work for Crystal ? - don't answer that.

I tried the running total using DistinctCount. The summary worked but the criteria was not selecting properly. Maybe I was doing something wrong.

You triggered a thought and I have managed to get the results using an If statement on the group summary (week).

if (Minimum ({@NumberValue},{Week})=0) then
    DistinctCount ({@NumberValue},{Week}) - 1
else
    DistinctCount ({@NumberValue},{Week})


I have used the idea that if a record exists containing 0 then just take 1 of the total, therefore not including those records in the count.

Cheers.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close