I hope this is something that we can easily do. I have a repeating group that lists hours going across. The hours are calculated from an In and Out field. Here the hours are calculated in the text field in the repeating group. What that means is there isnt any calculation being done on the fields themselves. That makes it difficult for me to figure out how to sum the hours. Please see this video for more information.
I just replicated exactly what you have described by using disabled input fields (as opposed to text elements) formatted as integers for the cells in which the calculations are being done, and then the cell with the sum is also a disabled input field that is just the first cell plus the next cell plus the next cell and so on.
I’m sure there are a number of other ways to do what you are trying to do, but maybe that way would work for you?
Can you try format as hours?
I think only Type of content:number’s repeating group can use “sum” function.
And date format can change to number by format as hours.
Thank you for looking into this with me. I appreciate any help. That is what I am trying to do, however, there is still another piece that needs to be looked at. I can better explain it in a video. There is also something else that I am looking for help with on another thread that you might know. Here is hoping!
My apologies, @ben4… when I responded the first time, I didn’t understand exactly what you are trying to do. After watching the second video, it looks like when you enroll a student, you create three attendance records, and you are trying to get the hours from each attendance record to show in separate columns in the appropriate student’s row. Finally, you want the hours from each column in a student’s row to display as a sum at the end of the row. So, if I have all of that correct, it should look something like this?
@mikeloc Absolutely!! Was that easy?? ha! I just want to ask, are those hours being totaled from a date in - out. I don’t know if that really matters, just wondering.
@ben4 It wasn’t difficult to get it working once I understood what you are trying to do. Kudos to you for including those videos, by the way… they are super helpful!
Yes, the hours are being calculated from a date in/out, although I chose to do the calculations when the records are created and store the hours in the db. I also have a separate table for the student (separate from the actual attendance records, that is). So, when a name is entered and the button is clicked, I create a record in the student table, and then I create three records in the attendance table for that student. With that structure in place, I have a main repeating group to show the students, and I have a repeating group inside of the main repeating group to show the attendance hours for each student.
Anyway, that’s the gist of it. If any of that sounds like it would be useful to you and you need more details, just let me know and I will be happy to grab some screenshots.
@ben4 In the attendance datatype, I created an hours field with a field type of number. I populate this field as follows:
When the Enroll Student button is clicked, I create a student record. The next step in the workflow creates the first attendance record like so (ignore the time in/out values… I just threw something in there to get some data):
Now that the attendance record has been created and it has values for time in/out, the next step in the workflow makes a change to the attendance record to calculate and populate the hours field like so:
I think that is 50% of the way there. I feel bad for having you do all this back and forth with me. Can you please take a look at this video and let me know if this helps you understand that last hurdle:
All of this is to accomplish one thing, that is the totaling of hours in a sum text. Thing is when a class day has more than 7.5 hours we want the system to automatically subtract 1 hours for break time. That conflicts with the sum, obviously. Using your method of writing the hours to the DB would solve this issue, just cant get one aspect to work, per the video.
So, in the teacher view, the teacher has to click those check in and check out buttons, right? If so, couldn’t you make changes to the associated attendance record when the check out button is clicked and calculate/populate the hours field at that time since you have both a time in and time out value then?
Hmm… you are showing the formatting on the display field, but are you doing any formatting in the workflow when you calculate and save the hours to the db? If you try formatting to two decimals places there, does that work?