Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula that ignores the selection formula Post Reply Post New Topic
Author Message
SSLead
Newbie
Newbie


Joined: 15 Jul 2014
Online Status: Offline
Posts: 18
Quote SSLead Replybullet Topic: Formula that ignores the selection formula
     Posted: 01 Aug 2014 at 5:55am
I have a report that has the following selection formula to only pull records that have work orders submitted between 5:00 and 5:30.

Selection Formula:
{@Open Date} = {?Request Date Range}
and
datepart('w',{@Open Date}) in 2 to 6
and
time({@Open Date}) in time(17,0,0) to time(17,30,0)

However, in order to calculate an accurate average per day, I need to include the days that had 0 work orders between 5:00 and 5:30. I calculate the number of days as follows to be used in the average formula.

date({TASKS.OPENDATE})

Unfortunately this only counts the number of days that had work orders between 5:00 and 5:30 because of the selection formula. I need to know the number of weekdays that there were work orders submitted in general. Is there something I can type in the Number of Days formula to ignore the selection formula when calculating that number and add a separate selection formula within the Number of Days formula? I would want to pull the number of days from the requested date parameter and M-F only and NOT the 5:00-5:30 selection.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 05 Aug 2014 at 5:14am
{@Open Date} = {?Request Date Range}
and
datepart('w',{@Open Date}) in 2 to 6
//and
//time({@Open Date}) in time(17,0,0) to time(17,30,0)

this should get you all the weekdays.

you can then put logic to suppress and calculate what you want. It will probably be tricky to calculate what to display...and remember that all the aggregate function work on all the data, so avg() will give the average of all the data whether or not you displayed it.

shared variables in the formulas would probably be your best bet for calculations as you can control what values you choose to include or exclude from the calculations.

HTH
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