Jump to content

This topic is 7722 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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

Posted

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

Posted

Thank you Brugmann and Fenton! This works well. smirk.gif

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.... frown.gif

I hope you have a solution!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.