Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Problems with calculating sum & avg w. conditions Post Reply Post New Topic
Author Message
alibobs
Newbie
Newbie


Joined: 19 Sep 2012
Online Status: Offline
Posts: 1
Quote alibobs Replybullet Topic: Problems with calculating sum & avg w. conditions
    Posted: 20 Sep 2012 at 5:10am
I'm a newbie at CR 7 (sorry if I'm not following etiquette or this has been posted before). I've been given a pre-existing CR file to edit. Basically what I need to do is:
a) retrieve data for 'year' and 'year-1' (done)
b) based on retrieved data: if 'sales_value_for_month' > 500, include it in the dataset to calculate summaries
c) need the following summaries:
    1) sum of 12 months of data for both 'year' and 'year-1' as summary
    2) average of 12 months of data where average=(sum of monthly values>500)/# of months with values>500

I've tried the sum and avg functions but I'm not getting the data I need and I don't know enough about how to create custom formulae to sort this out.

Any help/guidance is appreciated.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 20 Sep 2012 at 9:03pm
Hi
 
I really don't know whether you can create running totals with CR7.  Under Field Explorer, you will find running totals. 
 
Try to create two running totals one for sum of months value >500 and other for count of months where value>500
 
 
To get sum of months value >500 :
 
Create new running total-- Select the amount field-- select 'sum' to get summaries
 
Evaluate : use formula and say sum(value) > 500
 
reset --never
 
create one formula to arrive average.
Thanks,
Sastry
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 21 Sep 2012 at 4:30am
IIRC, running total weren't available in CR7.  :(
 
Is Sales_value_for_month a field in your data or is it something you have to calculate?
 
-Dell
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.031 seconds.