Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in Calculating Group Totals

Status
Not open for further replies.

dev777

Technical User
Dec 8, 2009
24
US
Hi,

I have 4 groups,
Group I - {CTL.MarketType}
Group II - {CTL.OrderType}
Group III - {CTL.Status}
Group IV - {CTL.OrderType}

Now, i want to calculate totals say sum({CTL.Amount}) for each group..

For Group IV - Sum({CTL.Amount},{CTL.OrderType})
For Group III - Sum({CTL.Amount},{CTL.Status})
For Group II - Sum({CTL.Amount},{CTL.OrderType}) ?????
For Group I - Sum({CTL.Amount},{CTL.MarketType})


I dont have problem with Group I and Group III.

How about Group II and IV. I tried to use GroupNumber function but its always returning 1, so this function is not working.
Any other functions in crystal reports or any other way to solve this problem..?
 
Your current formulas are correct as they are. I'm wondering how the results you are getting are different from your expectations.

-LB
 
Oh .. am sorry .. it isnt the sum which is required. Its the average which is needed.

Sum({CTL.amount},{CTL.OrderType})/Sum({CTL.gross},{CTL.OrderType}).

I can calculate this for Group I and Group III and is correct.

But the thing here is there are two groups on same field
for Group II and Group IV. So how to calculate this average.


Is there any function or alternative to do this..??



 
This doesn't look like an average to me. I guess you mean there are two instances of the other two groups? Please show sample data across these groups to illustrate the issue.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top