chuchuchui
Technical User
I'm using Crystal XI on Windows 2000 server with IBM UniVerse.
I am trying to total a columns which for some reason has a number of duplicates. The formula is mostly from Ken H's site.
First I created a running total named LiabBICSL with a distinctcount on PA_Coverages_VehicleNo.VEHICLENO; Evaluate for each Record; Reset on change of group Group #1: Policies.Policies_ID
I then went on to create three formulas:
1: To count everything and total it; this is in the Details section, which is supressed.
NumberVar Prior;
NumberVar Liab;
WhilePrintingRecords;
if {#LiabBICSL} = Prior + 1 //which indicates a first record for this customer
then Liab := Liab + {PA_Coverages_VehicleNo.LIABPREM};
Prior := {#LiabBICSL}; //store the current count to compare with next record
Liab;
2: To Display the total in the group footer section. The .01 is just because the numbers are stored multiplied by 100; I don't know why.
NumberVar Liab;
WhilePrintingRecords;
Liab * .01;
3: Reseting the variables to 0 in the group header which is supressed.
NumberVar Liab;
NumberVar Prior;
WhilePrintingRecords;
Liab :=0;
Prior :=0;
It almost works except for some reason or another it doesn't seem to add the first record so if there should be four distinct records is totals only three of them. Even when I have displayed the Prior variable it seems to miss the first record. Any ideas?
I am trying to total a columns which for some reason has a number of duplicates. The formula is mostly from Ken H's site.
First I created a running total named LiabBICSL with a distinctcount on PA_Coverages_VehicleNo.VEHICLENO; Evaluate for each Record; Reset on change of group Group #1: Policies.Policies_ID
I then went on to create three formulas:
1: To count everything and total it; this is in the Details section, which is supressed.
NumberVar Prior;
NumberVar Liab;
WhilePrintingRecords;
if {#LiabBICSL} = Prior + 1 //which indicates a first record for this customer
then Liab := Liab + {PA_Coverages_VehicleNo.LIABPREM};
Prior := {#LiabBICSL}; //store the current count to compare with next record
Liab;
2: To Display the total in the group footer section. The .01 is just because the numbers are stored multiplied by 100; I don't know why.
NumberVar Liab;
WhilePrintingRecords;
Liab * .01;
3: Reseting the variables to 0 in the group header which is supressed.
NumberVar Liab;
NumberVar Prior;
WhilePrintingRecords;
Liab :=0;
Prior :=0;
It almost works except for some reason or another it doesn't seem to add the first record so if there should be four distinct records is totals only three of them. Even when I have displayed the Prior variable it seems to miss the first record. Any ideas?