Running Total with a Max
Have a timesheets table and it helps with accruing Paid time off.
I need to implement a policy that PTO will max out at 160 hours in a running total field.
The running total field looks like this:
var text QONE = "{23.BF.'" & [Date] & "'}AND {56.EX.'"& [Related Resource] &"'}";
var text QTWO = "{23.EX.'" &[Date] & "'}AND{3.LTE.'" & [Record ID#] & "'}AND {56.EX.'"& [Related Resource] &"'}";
Min(160,Nz(SumValues(GetRecords($QONE),193)+Nz(SumValues(GetRecords($QTWO),193),0)))
THE PROBLEM: When I use the Min function it doesnt calculate against the 160 value in the formula. If the balance is 200 hours, any subsequent line entries build off the 200 value although the table above shows 160.
Here is the table without the Min function:
When I try to change the formula in the PTO in the something like
If([PTO BALANCE]>=160,0,[Hours worked]*[PTO Rate]
I get an error that I cannot write a formula for a field that is based on itself.
---------------------------------------------------------------------------
I also tried the pipeline approach but since PTO in is a calculated field I hit a road block as well.