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

Suppress by Contribution

Status
Not open for further replies.

LLowrance

Programmer
May 11, 2004
47
US
CR 8.5
SQL Database

I'm not sure I've titled this question correctly so forgive me. I have a issue with trying to suppress a group based on their contribution to the group.
I have claims that are worked by employees that run timers for each task they perform. Their timers are totalled and divided by the total timers for the claim. If any one employee's contribution to the file is >69% then all employees contribution should be suppressed. Here is my layout.

GH1-ClaimFile (suppressed)
GH2-Employee (suppressed)
D-Timer Detail information (suppressed)
GF2-Employee, eetotal timers, @%contribution(eetotal/filetotal)
GF1-ClaimFile, filetotal timers (suppressed)

As you can see all is suppressed except the GF2 section which shows the employee and % contributed. If any one EE contributed over 69% I need to suppress all GF2 for that claim file.

Thanks

-LLL
 
I've not used version 8.5 for a long time, but I think there was a Group Selection option under Report. But I think this would only work if your values were calculated using Summary Totals. (If you're not already familiar with Crystal's automated totals, see FAQ767-6524.)

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
LLowrance,

I tried something similar with my dataset, where trying to conditionally supressing a subsection based on the group outside of it and was unsuccessful. I personally am unsure if your request can be completed in a single pass.

My test was:
GH1: Account Type
- GH2: Product Type
- - Details: Accounts (namely Balance)

I tried to supress all products within GH1 where the total balance of any one product is over a certain threshold, and was unsuccessful - if only suppressed the GH1 section itself, and I beleive the summary updated to the GH1 level for the supression, even though I specified GH2 in the code.

Sorry not of more help, I have found this solutions often best tackled by doing some calculations at the database level and having a table or view generated for reporting.

Cheers!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
You can handle this by saving the report as a subreport under a new name and then reinserting it and linking the sub on the group #1 field. Place the sub in a GH1a section and move the groupname to a GH1b section. Then in the sub create a formula like this and place it in the GH#2 section:

whileprintingrecords;
shared numbervar maxpct;
if {@%contribution} > maxpct then
maxpct := {@%contribution};

In the main report, add a reset formula to the Group #1 Footer:
whileprintingrecords;
shared numbervar maxpct := 0;

In the main report section expert->GF#2 AND for GH1b->suppress->x+2 ->enter:
whileprintingrecords;
shared numbervar maxpct;
maxpct > 69

Then you can also make GH1a disappear by doing the following:

Suppress all sections WITHIN the subreport. In the main report, remove the subreport borders (format field->borders) and also format the subreport (subreport tab) to "suppress blank subreport". Then in the section expert of the main report->GH1a->check "Suppress blank section". What you cannot do is suppress the subreport directly or the section in which it is located.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top