freecolours Posted December 10, 2003 Posted December 10, 2003 I try to count the exact amount of days that are listed in a timesheet portal. For example: in the portal are working hours listed from a person; the person can create multiple records on one day. The portal can contain more than -for example- one 12/12/2003. My question is: Is it possible to show in a calculation field the exact amount of days that are listed in the portal?
dbruggmann Posted December 10, 2003 Posted December 10, 2003 I found a way, but I'm quite sure there are other possible approaches. Look at the files if it fits your solution. I used three calculation fields in the Timesheets.fp5 file to resolve the duplicate dates for every person: - c.eliminateDoubles puts for unique dates "1" and for duplicates "0" - c.countDoubles counts the number of duplicates for every date of a person - c.addDoubles finally puts for unique dates "0"; for the duplicates it puts "1/c.countDoubles" = 1 In Main.fp5 the calculation field c.days sums then for every person: "Timesheets::c.eliminateDoubles + Timesheets::c.addDoubles" AmountofDays.zip
Fenton Posted December 10, 2003 Posted December 10, 2003 Another approach would be to use the ValueListItems function (if you've got it). Create a value list, use values from a field, related values only, same relationship as portal, Date field. Create a calculation field, Unstored, = PatternCount ( ValueListItems (Status(CurrentFileName), "value list name"), " AmountofDays.zip
freecolours Posted December 11, 2003 Author Posted December 11, 2003 Thank you Brugmann and Fenton! This works well. I go one step further; Now I need to Count the overtime hours (from the portal) that are made each day. Problem is, is that there are multiple records in each day. This would be a logical calculation if the day had only 1 record: If(WorkedTime > RequiredHoursPerDay , WorkedTime - RequiredHoursPerDay , ""). But unfortunate, this is not the case.... I hope you have a solution!
dbruggmann Posted December 11, 2003 Posted December 11, 2003 Hi freecolours In Main.fp5 you need additionally: - a number field Overtime.zip
freecolours Posted December 11, 2003 Author Posted December 11, 2003 Yes! I got it! Thank you so much! I even got to understand the principe behind it. I'm gonna use this trick probably a lot more!
Recommended Posts
This topic is 7722 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