Skip to main content
Question

Running total - PTO Days remaining

  • February 6, 2023
  • 0 replies
  • 115 views

Forum|alt.badge.img+11
Employee has 20 days at beginning of PTO time period
Employee has multiple time-off requests throughout the period.
How do I create a running total field [REMAINING DAYS] off of [DAYS ALLOWED] field?
thx

------------------------------
BuildPro
------------------------------

Forum|alt.badge.img+15
  • Registered
  • February 7, 2023
You need a formula field on the Employee table that will subtract the number of approved days that year from their Yearly PTO.

So the components are 
Number of days from the request
Requests from this year
Request Status is Approved

One more factor is the Field Type.   Are you tracking Numbers or Durations? If you are going to use the info in other calculations, I would go with Durations. 





------------------------------
Don Larson
------------------------------

MarkShnierYou
Forum|alt.badge.img+24
@BuildPro  do you mean a running total on a report?​

------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------

Forum|alt.badge.img+12
  • Registered
  • February 7, 2023
Don's schema seems pretty solid and scalable, but may be normalized a bit more than your needs, particularly regarding PTO Type and tracking history of Status changes? The many to many with a reverse relationship can be fairly challenging to wrap your head around.

I suggest keeping it simple, at least initially, and create a Summary field on parent table (Employees) that sums the child (PTO Requests) time. Then, subtract that value from the where you are storing the 20 day value on the Employees table. Watch out for your formula data types (duration vs. number), QB will bark at you and guide you to what it is expecting.

------------------------------
Brian
------------------------------