Summarize a value in the same table
I'm building a new Table [Daily Time Cards], now trying to calculate for overtime. I built formula fields for week and year number, with the idea that I would query the same table for [Related Team Member] those number fields and only render total hours logged for the week, not on the same Record ID (or blank, since could be the case initially).
Example: A user logging time submitted 38 hours previously this week in prior saved time cards. On Friday they have 4 hours to log.
- The highlighted field should summarize to 38
- The formula for the new timecard should calculate 2 hours at regular time, and 2 hours OT
I attempted to make this field work with a formula Query, then tried doing a self to self relationship. I think the FQ is the way to go, but I get an error "Expecting Records list but found text list" on GetFieldValues.
SumValues(
GetFieldValues(
GetRecords(
"{Related Team Member.EX.'" & [Related Team Member] & "'}" &
" AND {Week Of Year.EX." & [Week Of Year] & "}" &
" AND {Record ID#.EX.NOT." & [Record ID#] & "}",
[_DBID_DAILY_TIME_CARDS]
),
36
)
)
Recommendations are appreciated.