I have a Variable formula to count the number of customers that are New, returning, or Out of Business. I have a variable formula for each incrementing the count by one based on their sales. These variables is in the group footer for the customer. I created separate variable to print the total counts in the group footer for the division.
The total that prints is incrementing by one based on the value of the last customer. For example if the last customer is Out of Business then the Out of Business counter in overstated by 1.
Here is the Out of Business formula for the counter that is in the group footer for the customer
//@LYOBCountDiv
WhilePrintingRecords;
NumberVar LYOBCountDiv:=iif({@LYOB} <> 0, LYOBCountDiv +1, LYOBCountDiv);
Here is the formula to print it on the Group Footer for Division.
//@LYOBCountDivPrt
WhilePrintingRecords;
NumberVar LYOBCountDiv;
LYOBCountDiv is only on the Group Footer by Customer and LYOBCountDivPrt is only on the Group footer by Division.
This is what I get in the report
Customer1 New Out Of Bus Count = 0
Customer2 Repeat Out Of Bus Count = 0
Customer3 OB Out Of Bus Count = 1
Division Footer
New Count = 1
Repeat Count = 1
Out of Bus Count = 2
In this case New and Repeat are correct and Out of Bus should be 1. If the last customer was a New customer then the New count is wrong.
What am I Missing? I am using Crytal 8.5
Thanks!
The total that prints is incrementing by one based on the value of the last customer. For example if the last customer is Out of Business then the Out of Business counter in overstated by 1.
Here is the Out of Business formula for the counter that is in the group footer for the customer
//@LYOBCountDiv
WhilePrintingRecords;
NumberVar LYOBCountDiv:=iif({@LYOB} <> 0, LYOBCountDiv +1, LYOBCountDiv);
Here is the formula to print it on the Group Footer for Division.
//@LYOBCountDivPrt
WhilePrintingRecords;
NumberVar LYOBCountDiv;
LYOBCountDiv is only on the Group Footer by Customer and LYOBCountDivPrt is only on the Group footer by Division.
This is what I get in the report
Customer1 New Out Of Bus Count = 0
Customer2 Repeat Out Of Bus Count = 0
Customer3 OB Out Of Bus Count = 1
Division Footer
New Count = 1
Repeat Count = 1
Out of Bus Count = 2
In this case New and Repeat are correct and Out of Bus should be 1. If the last customer was a New customer then the New count is wrong.
What am I Missing? I am using Crytal 8.5
Thanks!