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

Suppress GH1 when GH2 suppressed

Status
Not open for further replies.
Nov 15, 2000
322
US
Report structure:

GH1 (Insurance Claim Number)
GH2 (Policy Coverage)
D ({Person} and {LossesPaid})

I'm building a report for an insurance company that will tell them every time the company has paid out more than the policy limits. An insurance policy has "per person" limits and "per coverage" limits.

I've queried and summed in the SQL selection, so the dataset has one record per Detail record. The payments to each person are already summed in the data select.

The following 2 formulas are used in the Suppression rule for all 3 sections of the report. If both are false, then suppress.
@PerPersonExceeded
Code:
if {LossesPaid} <= {PerPersonLimit} then false else true
@PerCoverageExceeded
Code:
if Sum ({LossesPaid}, GH2 ) <= {PerCoverageLimit} then false else true

This works perfectly for the D and GH2 sections, but GH1 is wildly sporadic. Sometimes it suppresses, and sometimes not. I think it's because the additional GH2 and Detail records that are being suppressed because they don't exceed either limit are reseting the formulas to False on those claims that have suppressed details/GH2 after records that are not suppressed. So when Crystal gets to GH1, the value is False when it should be True.

After reading some other threads, I decided to switch from True/False to 1/0 and try to sum the formulas at each record. This works for @PerPersonExceeded, but not for @PerClaimExceeded. Since this formula is based on a group sum already, Crystal won't let me sum it again.

I can't rely solely on the @PerPersonExceeded, because they may all be false, but the aggregate sum of the payments as used in the @PerCoverageExceeded could surpass the per coverage limit.



Monkeylizard
Sometimes just a few hours of trial and error debugging can save minutes of reading manuals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top