Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Avg. summary Post Reply Post New Topic
Author Message
customreport
Newbie
Newbie


Joined: 26 Jan 2011
Location: United States
Online Status: Offline
Posts: 28
Quote customreport Replybullet Topic: Avg. summary
    Posted: 27 Jan 2011 at 2:39am

I have a report where I'm summing item amounts booked daily.  I want to add an average daily summary, but when I do the average it gives me the average item amount.  How do I create an average for the daily sums?  I tried writing a formula where I average the sum, but it says field cannot be summarized.

customreport
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 27 Jan 2011 at 3:17am
you need to do the averaging yourself.  You will need to sum up your daily sums and then divide by the number of days.
 
You can accumulate the sums using running totals (DBlank's forte) or you can use a series of formulas that does the same thing.  If your daily sums use some logic to include/exclude values then you can increment your variable in that logic. if it multiplies different columns together to get the sum try something like Average({table.field1}*{table.field2}, {grouping})...if your group is on days, it should work.
 
as you might have guessed, there are many ways to accomplish your goal, and depending on how your data / report is structured will point to the solution that best fits your situation.
 
HTH
IP IP Logged
customreport
Newbie
Newbie


Joined: 26 Jan 2011
Location: United States
Online Status: Offline
Posts: 28
Quote customreport Replybullet Posted: 27 Jan 2011 at 5:44am
This is the formula I used;
average({v_txn_sales_order_line.amount_amt},GroupName ({v_txn_sales_order_line.transaction_date}, "daily"))
 
when I checked the formula it said field cannot be used as a group condition field.  I have my transaction date grouped by day and my line.amount field is summarized by sum by transaction date.  I can take the grand total and divide by the number of days to get my daily average, but I'll have to change the formula everyday to adjust for the added day.  There has to be a better way.  I'm trying to keep an updated month to date sales bookings.
customreport
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 27 Jan 2011 at 7:51am
"daily" isn't the name/value that CR is using in the grouping of the report.  if you change the formula to use the field or formula that CR is using, it should work as you desired.
 
HTH
IP IP Logged
customreport
Newbie
Newbie


Joined: 26 Jan 2011
Location: United States
Online Status: Offline
Posts: 28
Quote customreport Replybullet Posted: 28 Jan 2011 at 8:38am
I just inserted the group field from the report fields in the formula workshop and GroupName ({v_txn_sales_order_line.transaction_date}, "daily") is what CR has.  It still says group can not be used as a group condition.

Edited by customreport - 28 Jan 2011 at 8:38am
customreport
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.012 seconds.