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

Counting Instances of Customer Number

Status
Not open for further replies.

BParsons

Technical User
Jan 27, 2005
33
US
I’ve been working on a report that identifies loans that are to be written off and have one last issue before it’s done. The problem is that in situations where a customer is listed multiple times it lists their total deposit balance for each instance (used for calculating net charge off amount) which causes the data to be slightly inaccurate. What I was thinking is that if I could identify the first instance of each customer on the report and only include the deposit balance for that instance it should work, but I’m not sure how or if this can be done.

I’m open to any suggestions if anyone has another way to do this but whatever the solution is it has to be able to be used in a formula and be summarized.

CR 10
DB2 Database

Thanks,

Brad
 
How do you define 'first'? Given a random list of records for a customer how would you know which was the first?

 
Just the first time the customer appears on the report. It's grouped by loan types so a customer could be included in the auto loan group and the credit card group, if the auto group comes first the balance would be with the auto loan and not the credit card. But, a customer could also have two loans in the same group so in that case it would need to be included for only one of those instances.

Thanks
 
If you have the option of using a SQL expression, create one like {%mindate}:

(select min(AKA.`Date`) from Table AKA where
AKA.`Customer` = Table.`Customer`)

You would substitute your exact field names for "Date" and "Customer" and your table name for "Table". Leave "AKA" as is, since it is an alias table name.

Then go to the record selection formula and enter:

{table.date} = {%mindate}

This should pull only the earliest record for each customer.

-LB

 
I still want to see all of the records but only attach the deposit balance to one of them.

Thanks
 
You could then remove the SQL expression from the record selection formula and create a formula:

if {table.date} = {%mindate} then {table.depbal} else 0

You could then insert summaries on this.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top