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

Conditionally Suppressing Group Headers

Status
Not open for further replies.

sarend

Programmer
Feb 22, 2007
11
US
I am working on a project in Crystal 10 that involves three Group Headers. GH1 gives totals for the Division, GH2 gives subtotals per Team in that Division, and GH3 gives subtotals per Sub-Dept for each Team in that Division.

Here is a section of the report:
GH1(Division) --> Partner Totals 100

GH2(Team) --> TS Transfer 50
GH3(Sub-Depts for that Team)--> TS Transfer 50

GH2(Team) --> Lead 50
GH3(Sub-Dept for that Team) --> Network Lead 30
GH3(Sub-Dept for that Team) --> Agent Lead 20

Here's the problem:
If GH3 contains only 1 Sub-Dept for a Team (GH2) and if GH3 has the IDENTICAL name as GH2, we want to suppress GH3 since it is duplicating data. This is shown in the above example with TS Transfer. Team TS Transfer(GH2) only has the Sub-Dept of TS Transfer (GH3). This causes 2 rows of duplicate data in the report.

Any help is greatly appreciated! Thanks
 
I think you could use a section suppression formula like this on GH3:

distinctcount({table.subdept},{table.team}) = 1 and
{table.team} = {table.subdept}

-LB

 
I tried that formula, but since GH3 and GH2 are both summaries, it will not allow to me to do a count on a summarized field. This is what i have:
DistinctCount(GroupName({sub-dept}),GroupName({team}))=1 and
GroupName({team}) = GroupName({sub-dept})

The error I get is: field cannot be summarized.
 
can you not check for the duplicates instead of checking for how many sub-depts there are?

surpression formula :
{GH2} = {GH3}
 
You say that you cannot do a count on a summarized field, which means you are not using the correct fields in the formula. Your formula should use the group fields (the fields being grouped on), not the group name.

DistinctCount({table.sub-dept},{table.team})=1 and
{table.team} = {table.sub-dept}

This formula should be entered in the section expert->gh3->suppress->x+2.

The first clause checks to make sure there is only one subdepartment in this instance of the team group, and the second clause checks to make sure that in this case the gh3 will only be suppressed if the sub-dept name is the same as the team name.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top