Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Count of meets average Post Reply Post New Topic
Author Message
rnelson330
Newbie
Newbie


Joined: 08 Jun 2011
Location: United States
Online Status: Offline
Posts: 3
Quote rnelson330 Replybullet Topic: Count of meets average
     Posted: 08 Jun 2011 at 6:54am
Hi.  I have a report that calculates the elapsed time, average elapsed time, min time, max time for work orders from openddate to closeddate.  I need to get the number of work orders whose elapsed time is less than or equal to the average.  I tried select expert and formulas but i am not able to use the boolean formula field in the select expert...and i can't seem to get the formula field to count the boolean field (wouldnt help much but i tried anyway).  Any ideas would be awesome.
 
rnelson330
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 08 Jun 2011 at 7:53am
Selection formulas are used to filter data.
You are interested in running totals, summaries, or normal formulas.
IP IP Logged
rnelson330
Newbie
Newbie


Joined: 08 Jun 2011
Location: United States
Online Status: Offline
Posts: 3
Quote rnelson330 Replybullet Posted: 08 Jun 2011 at 8:17am

thanks.  i tried regular formulas already and using a boolean field in a formula doesnt seem to produce any results.  the formula i have for determining if a work order's elapsed time is ({@DateDiff} <= Average ({@Elapsed Hrs}, {TASKS.TYPE})) but this returns a boolean value that is basically useless as far as trying to figure out how many work orders actually meet the average elapsed time between opening and closing.  I need a way to count the work orders whose elapsed time is less than or equal to the total average of elapsed time.

rnelson330
IP IP Logged
rnelson330
Newbie
Newbie


Joined: 08 Jun 2011
Location: United States
Online Status: Offline
Posts: 3
Quote rnelson330 Replybullet Posted: 09 Jun 2011 at 3:05am
I created a formula field (number format) where the formula is "If ({@DateDiff} <= Average ({@Elapsed Hrs})) then 1 Else 0" where the datediff is the calculation for each individual work order's completion time and the average elapsed hrs is the average of the elapsed time over all the work orders in the report.  When I place the new field into the report, 1's and 0's appear, but even though the field is in the report and is numeric, it doesn't show in the Insert Summary list of fields.  I cannot figure that out...
 
rn
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 09 Jun 2011 at 3:19am
You can try creating a running total that evaluates only when the above condition is met.
IP IP Logged
wunof11
Newbie
Newbie
Avatar

Joined: 21 Aug 2011
Online Status: Offline
Posts: 11
Quote wunof11 Replybullet Posted: 01 Sep 2011 at 7:15pm
I have a similar problem. I want to count the received date fields which are null,i.e. incomplete order.

I'm trying to work with running totals that evaluate if the field is null (true) using the isnull function and then count how many true's are returned. SO far all I get is 0.

Did you ever get your formula running?
IP IP Logged
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