I have an app that I have a column called Work Hours this is a rollup of all of the hours entered by the user. I need to split the hours into each respective week of the month to show how many hours are being worked in each week.
This is all in a SharePoint list so the data has the actual date it was entered in the app captured in SharePoint.
How can I do this?
Hello @Dorinda ,
With "WeekNum()" you can check if the week number the employee entered his work hours is the same as the week number you're displaying in your table.
I made some progress in my gallery getting the week number
Now I need to sum up each of those weeks to get total for each week. That is where I am stuck now.
If I understood you well, using your picture as example, you want the sum of the "Total Hours" of each day for a specific "Week Number"?
I don't know how your app was built, so the best solution I can give you is this formulae:
Sum(Filter(cltYourCollection;WeekNum(yourDate) = WeekNum(currentDate));'Total Hours')
Basically, you're giving the "Sum()" function a table of all records whose week number is equal to the week number you're looking for. The second parameter should be the column corresponding to the "Total Hours" (it's also an expression, so you can put in an arithmetic operation such as an addition of multiple columns if you need).
This is giving me all kinds of errors, I have the collection called colpwrsysele, this has all of the information from the SharePoint list. My Date field in SharePoint is Called Date (yes I know i blew that one), but I am not sure if that is correct
Sum(Filter(colpwrsysele;WeekNum(DatePicker1_2.SelectedDate) = WeekNum(DatePicker1_2.SelectedDate));'Total Hours')
because I am getting all kinds of errors
Could you give the list of the errors you're encountering please?
Is "Total Hours" part of your SharePoint list, or is it calculated inside your app?
By the way, you're comparing "WeekNum(DatePcker1_2.SelectedDate)" with itself, which will always return "true". In my exemple, I was suggesting comparing "WeekNum(collection.Date)" with "WeekNum(DatePicker.SelectedDate)", which should return "true" only if the date of the record has the same week number as the date selected in the datepicker.