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!

Special Counting Problem

Status
Not open for further replies.

bidra

Programmer
Feb 28, 2002
31
DE
Using CR 10

Hello,

my record consist of data fields benefit number (BNO), insurance number (INO), AMOUNT and some others not relevant for the problem.

For the report the group has to be on BNO and running totals have to be derived from AMOUNT and from the number of cases.

Now the problem comes with counting the cases:

There can be more than one record with same INO and different or even same BNO.
Every record has to be counted as one case.
The exception are records with same INO but more than one occurences of BNO in [1612, 1613,1621, 1623].
This has to be counted as one case but
AMOUNT has to be summarized with every record!!

I tried but it drives me nuts .. I can't get the exception counted correctly.

Any clue out there?

Many thanx in advance

Bidra
 
The easiest solution might be to insert a subreport in the report footer, where INO is Group #1 and BNO is Group #2. I think you can insert a distinctcount on INO, and for the amount, use a running total (sum of amount), evaluate based on a formula and use something like:

(onfirstrecord or
{table.INO} <> previous({table.INO})) or
{table.BNO} in [1612,1613,1621,1623]

If this still doesn't work, I think it would help if you provided some sample data at the detail level along with the results you hope to see.

-LB
 
Hello Ibass,

I inserte a subreport in the report as you said. But where do I have to put the formula you suggested?

Here some sample date form detail level:

BNO INO Amount

1111 1601 10.00
1111 1602 11.00
1111 1612 12.00
1111 1612 15.00
1111 1612 03.00
1111 1613 13.00
2222 1601 10.00
2222 1612 09.00
3333 1613 10.00
4444 1601 20.00
4444 1613 10.00
4444 1621 10.00


Here what I hope to see in my main report:

INO
---

1601 3 Counts
30.00 Running total amount

1602 1
11.00

1612 3
39.00

1613 2
20.00

1621 1
10.00



Bidra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top