Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Conditional Formatting Post Reply Post New Topic
Author Message
Winfield
Newbie
Newbie


Joined: 30 Mar 2012
Online Status: Offline
Posts: 1
Quote Winfield Replybullet Topic: Conditional Formatting
    Posted: 30 Mar 2012 at 7:24am
Hello all,
 
I am trying to create a report that shows how many High and Critial Incidents gets logged after hours.  While I am able to create the report showing me ALL the High and Critical Incidents, I only need the ones that are after hours (between 5pm and 5am) and on Weekends.
 
I figure I can use conditional formatting to filter out High and Critical Incidents logged during business hours (5am -5pm, M-F), but so far I am unable to think of a way to do that.  Any suggestions?
 
Thanks.
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 01 Apr 2012 at 11:46pm
This is a formula I use to determine how much work people do during overtime hours, you can use the same princinple to get what you need;
 
Numbervar array wkdystart:= [0, 9, 9, 9, 9, 9, 0];
numbervar array lunchstart:=
    if {Command.BaseUserName} in ["Ryan Rowland"]
        then [0, 12, 12, 12, 12, 12, 0]
    else if {Command.BaseUserName} in ["Emma Hall"]
        then [0, 12.30, 12.30, 12.30, 12.30, 12.30, 0]
   
    else[0, 13, 13, 13, 13, 13, 0];
numbervar array lunchend:=
    if {Command.BaseUserName} in ["Ryan Rowland"]
        then [0, 13, 13, 13, 13, 13, 0]
    else if {Command.BaseUserName} in ["Emma Hall"]
        then [0, 13.30, 13.30, 13.30, 13.30, 13.30, 0]
    else [0, 14, 14, 14, 14, 14, 0];
numbervar array wkdyend:= [0, 17, 17, 17, 17, 17, 0];
if dayofweek({Command.TimeStamp}) in [7,1]
then "Weekend"
else if {@Hour} = 1
then "Time Unknown"
else if {@Hour}  < wkdystart[dayofweek({Command.TimeStamp})]
Then "Morning OT"
else if {@Hour}>= wkdyend[dayofweek({Command.TimeStamp})]
then "Evening OT"
else if ({@Hour}>= lunchstart[dayofweek({Command.TimeStamp})] and {@Hour}< lunchend[dayofweek({Command.TimeStamp})])
then "Lunch OT"
else if ({@Hour}>= wkdystart[dayofweek({Command.TimeStamp})] and {@Hour}< lunchstart[dayofweek({Command.TimeStamp})])
then "NT AM"
else if ({@Hour}>=lunchend[dayofweek({Command.TimeStamp})] and {@Hour}< wkdyend[dayofweek({Command.TimeStamp})])
then "NT PM"
else "Time Unknown"
 
Your formula shouldn't need to be as complex as that as I'm guessing you don't need to take into consideration lunch hours nor individual people who work different hours.
 
Regards,
Ryan.


Edited by rkrowland - 01 Apr 2012 at 11:59pm
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.