# Thread: averaging based on conditional object

1. ## averaging based on conditional object

I have a report that prints a numerical field in "red" if a conditon from a check box is true or "black" if the condition is false. At the end of the report are summary fields for average, lowest and highest. How can I make these summaries only consider when the field is "black"?

2. ## RE: averaging based on conditional object

Ralph,

Do you want the sumamry fields to print only if a field in the report detail section is "black"?

kenn

3. ## RE: averaging based on conditional object

Design calculated fields for the report

tot = if(logicalfield=.F.,numericfield,0) and
count = if(logicalfield=.F.,1,0)

then you can either drag these fields into the summary area, or define your own

total value of falses = total(tot,GRP->GRAND)
max value of falses = maximum(tot,GRP->GRAND)
avg value of falses= total(tot,GRP->GRAND)/Count

but that won't get you to the minimum value.

You may have to create a group in the report, based on the change in the logical field, then do your summaries in the group footer, then copy or drag these summary fields to the report footer.

4. ## RE: averaging based on conditional object

Thank you for answering. Yes, the summary field would still print and would be 0.

5. ## RE: averaging based on conditional object

Thanks for the help. It worked fine.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•