Scott Johnston
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.
//@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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I like previousrecord, never used it,
when I try the command I get a error the formula result must be a Boolean?
when I try the command I get a error the formula result must be a Boolean?
ASKER
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.
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.
ASKER
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?
If I can I not sure how?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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!
ASKER
Thanks for the Support
ASKER
Group1 Customer
Group2 invoice #
Details (products)