Forum Discussion
Problem calculation total work hours
Hi ceebu
I'm almost there, but when i adopt the solution to my original BI project i get a much to large sum off Employees Total Hours.
I belive it's because the calculation is done to each employee in the Employee table. However we have a lot of Employees in the table that aren't "active". I probably need to filter thoose out in the function.
The tables are connected to a table holding entries of how many hours each employee have worked (HoursWorked). I probably need to filter the function so it only calculates Employees Total Hours if the employee has entries in the table with the hours worked. The field with the hours worked are called "WorkHours"
Does that sound right - and how to?
The tables are connected to a table holding entries of how many hours each employee have worked (HoursWorked). I probably need to filter the function so it only calculates Employees Total Hours if the employee has entries in the table with the hours worked. The field with the hours worked are called "WorkHours"
Does that sound right - and how to?
I didnt see this table in the sample you had uploaded, so replicated the function using a calculated column. (Also no HoursWorked in the three tables in your .pbix file) If you already had a list of days the employees haad worked, then you could use that to filter the total number of hours worked by the employee for the month.
- HenrikH299 years agoAdvocate I
Hi ceebu
No the table HoursWorked wasn't in the sample. I have several tables not included since it would be a huge task to make af sample of all the tables.:smileyhappy:
The table Hoursworked holds entries per employee per customer they have worked on. So theres many entries per day for the same employee.
You are suggesting to filter using the Hoursworked table, it just can't figure out how - using a join or a function ?
My problem is that it calculates all hours fore all employes in the Employee table. However i only wnat it to calculate on the emplyees who have entries in the Hoursworked table.
- ceebu9 years agoAdvocate I
You can easily add the Active status of the employee to the filter (visual filter or page filter or report filter) to achieve the desired result.
I added a new table with the Status Fields, and created a few employee records with Inactive status.
Then, I added the Status as a filter in the visual:
See the result with / without the filter.
Download the Updated PBX file here -
- HenrikH299 years agoAdvocate I
Hi ceebu
When i I download the updated file i get my "old" one. No ekstra table etc.
Perhaps you have oploaded the wrong one ?
However filtering using an "Active" field will not do the trick since employees going from Active to Inactive during the year has to be included.
I need to filter/calculate only on the emplyees who have entries in the Hoursworked table. That way they are included whether being Active or not (shiftet status) during the year.