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

how to count raws in the group in the report?

Status
Not open for further replies.

ndp

Programmer
Mar 3, 2003
121
US
Hi,
I am doing a report where I put sub total in the group footer. I need to show the total only if there are more than one raw in the detail section otherwise suppress it.
Can somebody suggest anything?

Thanks in advance,
ndp
 
Try something like this for your suppression formula:

Count ({Table.Field}, {Table.GroupField}) = 1

-dave
 
Right click on your sub-total field, choose Format Field. On the common tab click the (x-2) button for suppress. Find your summary field in the Reports Fields box and double click on the field. In the formula change your summary from what ever it was to Count and add =1 to the end of the formula. Save and Exit back to your report.

This:
Sum({your.Field},{your.Group})
Gets changed to:
Count({your.Field},{your.Group})=1

Mike
 
Create this formula to return a 1 or 0 based upon raws for each record, and place it in the details section.

@Evaluate_Raws
Code:
if {table.field} = "Raw" then //replace with the logic you need to determine a raw
    1
else
    0

Now, right click your summary field in the group footer, and choose format field.
Under the common tab, click the X+2 button to the right of suppress.
Enter the following logic in the formula editor:

sum({@Evaluate_Raws},{table.groupfield}) > 0
//replace {table.groupfield} with your database field you are using for this group.

Save and Close



~Brian
 
I realized I may over complicated this after seeing vidru's and mbarron's posts. It really comes down to how you determine a raw. How do you determine if something is a raw or if there is more than 1 raw?

~Brian
 
Thanks all of you.

I also tried something and it worked. I did distinct count of one of the field in detail section and suppressed if it was less than 2. This is the place where I always get my answers. I really appreciate it.

Thanks very much.
ndp
 
You're doing the same thing that vidru and I suggested. One caution with the distinct count. If you have even the slightest chance that the field that you are counting is going to have a duplicate within the group, change the summary to a Count. Otherwise you will be suppressing a valid result.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top