We help IT Professionals succeed at work.

# How to calculate minimum value of a field within a group

on
Medium Priority
754 Views
I was able to easily setup a summary to get the maximum value of a given field within a group, but now I need to figure out the minimum value of the same field.  The problem is the value of Zero should not be counted as the minimum value.  Let's say the field contains three values: 0.00, 1.12, and 87.3.  The minimum value should be 1.12 instead of 0.00.  How could I accomplish this?  Thanks for any feedback.
Comment
Watch Question

## View Solution Only

CERTIFIED EXPERT

Commented:
Hi cmp119,
Use a running total field to get the minimum.
Reset for each group and in the Evaluate For use a formula which says something like...
{table.field} <>0

Pete

Software Solutions Consultant
CERTIFIED EXPERT
Top Expert 2006

Commented:
Do you need to see the items that have 0.00? IF NOT, then just remove them from your report using SELECT EXPERT.

choose the value...and assign GREATER THAN ">" 0.00.

MikeV
IT Manager

Commented:
I tried your suggestions and they didn't work.  I search your site  a bit more and discovered the below resolution to work fine.  Thanks so much for your feedback.  I should of done a more thorough search before asking.  Thanks.

Date: 08/14/2004 06:58PM PDT

So what you want is the lowest value within each group, right?  In that case do this:

In the report header create this formula:

shared numberVar SmallestFound;

In the group header create this formula (just use a value larger than anything you'll see in your report):

shared numberVar SmallestFound := 99999;

In the details section create this formula:

if {table.field} > 0 and {table.field} < shared numberVar SmallestFound then shared numberVar SmallestFound := {table.field};

In the group footer put this formula:

shared numberVar SmallestFound;

You can suppress any of these formula so they aren't visible on the report.

HTH

frodoman
IT Manager

Commented:
I think the points should go to frodoman if anyone, but I could not figure out how to do it.  Otherwise, the question should be removed.  Thanks again.
Software Solutions Consultant
CERTIFIED EXPERT
Top Expert 2006

Commented:
Sounds good....

MikeV
Commented:
PAQed with points refunded (250)

Computer101

Not the solution you were looking for? Getting a personalized solution is easy.

##### Thanks for using Experts Exchange.

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile