Link to home
Start Free TrialLog in
Avatar of Scott Johnston
Scott JohnstonFlag for United States of America

asked on

Record counter reset when Customer Number changes

I set up a counter to count the number of invoices a customer generated during a period of time.
//@Counter of Customer Invoices
NumberVar invcounter;
whileprintingrecords;
invcounter := invcounter +1;

//@Counter of Customer Number
NumberVar counter;
whileprintingrecords;
counter := counter +1;

This counter works...However I need to reset the counter of the customer invoices when the next new customer comes up (I am using grouping on the customer number and Customer invoice.  This is so  I can determine that the invoice number changes I can compare data from the previous invoice for a specific product to see if selling that product(sample) produced new sales.

How do I reset the counter back to "0" if the customer number changes?

In summary I am trying to see if a sample product sold yesterday produced a new sale of that type of product today.
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Scott Johnston

ASKER

I just have:
 
Group1 Customer
Group2 invoice #
Details (products)
I like previousrecord, never used it,
when I try the command I get a error the formula result must be a Boolean?
hmmm, I took out ' : ' and it fixed the problem.
Previous record may not work because the invoice for each customer are not necessarly in order.

Customer A has invoice number 1234567 and his next invoice number is 2345690.

I got a false on every entry which I know there are 2 invoice in some cases.
I have distinct count setup already, I cannot use that to check to see if the record changed?
If I can I not sure how?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I beginning to think that as well...Marketing is trying to get data that will support a marketing program.  I have decided to break this into separate reports.
Thanks for the support!
Thanks for the Support