Hello All,
I am having difficulties while calculating the sum of the a field.
My report structure is:
Group Header 1#: Account Name
Group Header 2:# ACC_groups
Details: Deal_No, Amount
Group Footer 2#: Sum (Deal.Amount), Account Groups
Group Footer 1#: Sum (Deal.Amount), Account_Name
For the total I have implemented teh below formulas:
{@reset} in Group Header 1
whileprintingrecords;
numbervar sumpct;
numbervar grtotal;
if not inrepeatedgroupheader then (
sumpct := 0;
grtotal := 0
);
{@accum}
whileprintingrecords;
numbervar sumpct := sumpct + (Deal.Amount);
numbervar grtotal := grtotal + (Deal.Amount);
{@displaygrp} to be placed in the GF#1:
whileprintingrecords;
numbervar sumpct;
{@displaygt}
whileprintingrecords;
numbervar grtotal;
Now the problem is while displaying the sum in Group Footer 2: (EX:
G1-Header:MM100
G2-Header:123
Details:555 , 10000
556, 20000
G2-Footer Total: 30000
G2-Header: 233
557, 500
Total: 305000 ( instead of this figure, I want the 500)
Grand Total 305000
I tried to use the insert summary , but I can't get the correct figures because I am doing group selection:
{GL.GL_ENTRY_ID}= maximum ({GL.GL_ENTRY_ID},{Deal.DEAL_NO})
So, what should I modify in the previous formulas to get the 500 for the sum of the group instead of getting the sum of the whole amount?
Thanks
I am having difficulties while calculating the sum of the a field.
My report structure is:
Group Header 1#: Account Name
Group Header 2:# ACC_groups
Details: Deal_No, Amount
Group Footer 2#: Sum (Deal.Amount), Account Groups
Group Footer 1#: Sum (Deal.Amount), Account_Name
For the total I have implemented teh below formulas:
{@reset} in Group Header 1
whileprintingrecords;
numbervar sumpct;
numbervar grtotal;
if not inrepeatedgroupheader then (
sumpct := 0;
grtotal := 0
);
{@accum}
whileprintingrecords;
numbervar sumpct := sumpct + (Deal.Amount);
numbervar grtotal := grtotal + (Deal.Amount);
{@displaygrp} to be placed in the GF#1:
whileprintingrecords;
numbervar sumpct;
{@displaygt}
whileprintingrecords;
numbervar grtotal;
Now the problem is while displaying the sum in Group Footer 2: (EX:
G1-Header:MM100
G2-Header:123
Details:555 , 10000
556, 20000
G2-Footer Total: 30000
G2-Header: 233
557, 500
Total: 305000 ( instead of this figure, I want the 500)
Grand Total 305000
I tried to use the insert summary , but I can't get the correct figures because I am doing group selection:
{GL.GL_ENTRY_ID}= maximum ({GL.GL_ENTRY_ID},{Deal.DEAL_NO})
So, what should I modify in the previous formulas to get the 500 for the sum of the group instead of getting the sum of the whole amount?
Thanks