4Justme2 Posted June 21, 2012 Posted June 21, 2012 I’m trying to come up with a YTD balance on Personal time (which is a type of hours worked). I started by trying to determine the sum of HoursWorked when the Hrs_Type=”Personal”. This is where I am stuck. In this example my Starting Balance of Personal Hours is 32. Only two of my portal row entries have a Hrs_Type of “Personal”; one portal row with the entry, 8; and the second portal row entry of 3 HoursWorked—the sum of which should be 11. If I could get this function to work, I could then subtract that number (11)from the Current Yr Starting Balance of 32 resulting my desired YTD balance of personal time (which in this example would be 21). Can I entice someone to take a look at the attached zip file example and see if you can figure out what I need to do to get my desired result? Timecard.zip
No_access Posted June 21, 2012 Posted June 21, 2012 here is what I would do , create a second relationship and a portal to just show personal hours and sum that... please see attached. This also lets you change the key to see other hours such as sick time.. etc... Timecard Copy.zip
4Justme2 Posted June 23, 2012 Author Posted June 23, 2012 That's such a GREAT idea! Thank you!!! :yep:
4Justme2 Posted June 23, 2012 Author Posted June 23, 2012 This works so nicely. Is there a way to get this to year? How to explain this...? At the beginning of every new year, January 1st, I want the hours worked to revert to 0 hours... and then begin a new with summing the hrs worked? Is there a way to do that?
No_access Posted June 24, 2012 Posted June 24, 2012 try this.. I added 2 script triggers and changed the key to repeating fields... now you can enter multiple criteria or just one.. you can change the repeating field s and add script triggers to include anything you want... ie.. year 2012 or next year change it to 2013 let me know if this works fr you.. Timecardrevised.zip
4Justme2 Posted June 30, 2012 Author Posted June 30, 2012 SWEET!!! Many BIG thank you's... mp But I just realized... this works great as long as the "type" I pick is "personal". Eventually, I'd like to create fields that display the YTD balance of each type. I realized, when I picked a different type--other than "personal" it still included the hours in calculation fields. I tried playing around with this but had no luck. Any idea how I can restrict the type value to a specific type in calculations?
No_access Posted June 30, 2012 Posted June 30, 2012 they all come up with 2012 in the key remove that and put sick and you get only the sick hours"total" however if what you want is sick for the year 2012 I would alter the script trigger and assign a unique key for lets say sink in 2012 or personal in 2012 and make that your key. ie.. the new script trigger might be _TIMECARD::Hrs_Type&year(_TIMECARD::WeekendingDate) now your key would be sick2012 and that would only show you sick in 2012.. or personal2012 would show you personal in 2012 etc...
Recommended Posts
This topic is 4868 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now