×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Trying to create an hourly report

Trying to create an hourly report

Trying to create an hourly report

(OP)
I belive the error is in the formula or myself.

The formula I made is supposed to take the calls that are logged into our tracking program and give me an hourly total.  Currently it is getting confused by the AM PM and the Tracking software(Track-It!) doesn't seem to allow 24hour times.  

Here is what is in the formula:

StringVar Array Otime:= ["1:00","2:00","3:00","4:00","5:00","6:00","7:00","8:00","9:00","10:00","11:00","12:00"];
StringVar Array Omeridian:= ["a","p"];

 
if {TASKS.REQTIME} > '12:59p' and {TASKS.REQTIME} < '2:00p'  then Otime[1]+Omeridian[2]
    else
if {TASKS.REQTIME} > '1:59p'  and {TASKS.REQTIME} < '3:00p'  then Otime[2]+Omeridian[2]
    else
if {TASKS.REQTIME} > '2:59p'  and {TASKS.REQTIME} < '4:00p'  then Otime[3]+Omeridian[2]  
    else
if {TASKS.REQTIME} > '3:59p'  and {TASKS.REQTIME} < '5:00p'  then Otime[4]+Omeridian[2]
    else(etc. until I do all 24 hours in the day)

What ends up getting displayed is some times have both AM and PM(i figure this is because me > & < statement doesn't work with time the way I tought).  It also doesn't show me all the times, only 2pm-8pm and thats it.

Can anyone assist me in creating a report that will show values per hour?

RE: Trying to create an hourly report

PlaidEmp:

Try these for size!

2 formulas - First one gets hour of task - Group report by this, Second one counts tasks per hour

@EachHour
NumberVar HourPortion:= Val(Mid({TASKS.REQTIME},1,Instr({TASKS.REQTIME},":")-1));
NumberVar AdjustedHour:= if Right({TASKS.REQTIME},1)="p" Then HourPortion+12 else HourPortion;

@TaskCount
Count({TASKS.TASKID},EachHour)


Hope this helps

David C. Monks
david.monks@chase-international.com
http://www.chase-international.com
Accredited Crystal Decisions Enterprise Partner

RE: Trying to create an hourly report

You could also convert the string in the format '10:59p' to a time, using:
TimeValue({TASKS.REQTIME})
Then, using Hour(), you can extract the hours only, expressed in a 24 clock.

@Each Hour
Hour(TimeValue({TASKS.REQTIME}))

@TaskCount
Count({TASKS.TASKID},EachHour)

Malcolm

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close