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!

*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.

Jobs

Return only the first work week

Return only the first work week

(OP)
I am working on a HR report where i need to return a work pattern for each employee. A work pattern is the number of hours worked for each employee. As we have part time workers it is possible for an employee to work monday, tuesday and thursday.
When a new employee starts they are a allocated an existing working pattern that fits their hours and days or a new working pattern is created for them. When a work pattern is created the HR system generates the days they will be working upto a data in the future.
For example, Sally who started working with our organisation on the 8th of August works Tuesday, Wednesday and Friday only. Her work pattern would look like this

WorkPatternDate -- Hours
08/08/2016 -- 0
09/08/2016 -- 7.2
10/08/2016 -- 7.2
11/08/2016 -- 0
12/08/2016 -- 3.2
13/08/2016 -- 0
14/08/2016 -- 0

This is repeated for each day until a date in the future. My report is returning a row for everyday upto the end date. this is returning thousands of rows when what i want is to return the first week only. How can i do this?

the fields I have are
workpattern_ref
Workpattern_date
workpattern_hours
workpattern_name



RE: Return only the first work week

This is not a particularly efficient approach as it still need to pull back all records so it can establish the first date for each person. It also assumes you have it grouped by {Table.workpattern_name} but it should work. Place the following code into the Group Selection Formula:

CODE

{Table.workpatten_date} < (MINIMUM({Table.workpatten_date}, {Table.workpattern_name})) + 7 

If tis is still too slow, let me know what the data source is as it might be possible to use a SQL Expression or Command to improve efficiency.

Hope it helps.

Cheers
Pete

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!

Resources

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