GeorgeOrwell1984
Technical User
I'm trying to write a weighted average cost of debt report.
This is very easy to calculate in excel using:
sumproduct(a1:a15,b1:b15)/c15 or as per example below
I have the Values and multiplying factor coming in on the details lines and have used a simple formula (which I will call Weighted value)to multiply one by the other also on the Details line.
The details line is Grouped by Country
I have used a Whileprintingrecords 3 step variable to provide me with a Total in the Country Footer
What I want to do is get a grand total of this value in the Report footer.
This is proving very difficult. I am able to get a total in the RF but the total seems to double up the last details record in each group and gives me a false total.
I have tried to use next or last record to identify the last details record in each Country Group so that I can deduct this value from the Grand Total calculation but am unable to do this because of the data execution order.
e.g
Spain
Value Rate Weighted
30,000.00 2.5 75,000.00
12,000.00 1.5 18,000.00
150,000.00 1 150,000.00
95,000.00 3 285,000.00
Sum 287,000.00 8 528,000.00
WACD 1.8397
Mean Avg 2.0000
UK
Value Rate Weighted
100,000.00 2.5 250,000.00
50,000.00 1.5 75,000.00
100,000.00 1 100,000.00
75,000.00 3 225,000.00
Sum 325,000.00 8.00 650,000.00
WACD 2.0000
Mean Avg 2.0000
Grand Total 612,000.00
WACD 1.9248
Formulá's
Spain
Value Rate Weighted
30000 2.5 =C9*D9
12000 1.5 =C10*D10
150000 1 =C11*D11
95000 3 =C12*D12
Sum =SUM(C9:C12) =SUM(D912) =SUM(E9:E12)
WACD =SUMPRODUCT(C9:C12,D912)/C13
Mean Avg =D13/4
UK
Value Rate Weighted
100000 2.5 =C18*D18
50000 1.5 =C19*D19
100000 1 =C20*D20
75000 3 =C21*D21
Sum =SUM(C18:C21) =SUM(D1821) =SUM(E18:E21)
WACD =SUMPRODUCT(C18:C21,D1821)/C22
Mean Avg =D22/4
Grand Total =C22+C13
WACD =(C13*E14+C22*E23)/C26
Can anyone help?
Is there an actual operator or fucntion within Crystal for this...if so how does it work
Any help much appreciated
This is very easy to calculate in excel using:
sumproduct(a1:a15,b1:b15)/c15 or as per example below
I have the Values and multiplying factor coming in on the details lines and have used a simple formula (which I will call Weighted value)to multiply one by the other also on the Details line.
The details line is Grouped by Country
I have used a Whileprintingrecords 3 step variable to provide me with a Total in the Country Footer
What I want to do is get a grand total of this value in the Report footer.
This is proving very difficult. I am able to get a total in the RF but the total seems to double up the last details record in each group and gives me a false total.
I have tried to use next or last record to identify the last details record in each Country Group so that I can deduct this value from the Grand Total calculation but am unable to do this because of the data execution order.
e.g
Spain
Value Rate Weighted
30,000.00 2.5 75,000.00
12,000.00 1.5 18,000.00
150,000.00 1 150,000.00
95,000.00 3 285,000.00
Sum 287,000.00 8 528,000.00
WACD 1.8397
Mean Avg 2.0000
UK
Value Rate Weighted
100,000.00 2.5 250,000.00
50,000.00 1.5 75,000.00
100,000.00 1 100,000.00
75,000.00 3 225,000.00
Sum 325,000.00 8.00 650,000.00
WACD 2.0000
Mean Avg 2.0000
Grand Total 612,000.00
WACD 1.9248
Formulá's
Spain
Value Rate Weighted
30000 2.5 =C9*D9
12000 1.5 =C10*D10
150000 1 =C11*D11
95000 3 =C12*D12
Sum =SUM(C9:C12) =SUM(D912) =SUM(E9:E12)
WACD =SUMPRODUCT(C9:C12,D912)/C13
Mean Avg =D13/4
UK
Value Rate Weighted
100000 2.5 =C18*D18
50000 1.5 =C19*D19
100000 1 =C20*D20
75000 3 =C21*D21
Sum =SUM(C18:C21) =SUM(D1821) =SUM(E18:E21)
WACD =SUMPRODUCT(C18:C21,D1821)/C22
Mean Avg =D22/4
Grand Total =C22+C13
WACD =(C13*E14+C22*E23)/C26
Can anyone help?
Is there an actual operator or fucntion within Crystal for this...if so how does it work
Any help much appreciated