# Tracking staff leaves

**URL:** <https://community.glideapps.com/t/tracking-staff-leaves/70932>\
**Category:** Ask for Help\
**Created:** [February 18, 2024, 2:18pm UTC](https://community.glideapps.com/t/tracking-staff-leaves/70932 "2024-02-18T14:18:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aashi\_Maheshwari](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/aashi_maheshwari/32/71088_2.png) [@Aashi\_Maheshwari](https://community.glideapps.com/u/Aashi_Maheshwari)\
**Post date:** [February 18, 2024, 2:18pm UTC](https://community.glideapps.com/t/tracking-staff-leaves/70932/1 "2024-02-18T14:18:36Z")

</div>

I am working on App that tracks the presence and absence of staff and correspondingly deducts the pay if they have exceeded the number of fixed leaves.

While I have created the employee profiles, I am unable to add a date segment for the employer to mark the employee as absent. I want the employer to be able to select a single date or in bulk if it was a longer week. How can I do this?

---

<div class="post-metadata">

**Author:** ![Christopher\_Geyer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/christopher_geyer/32/85766_2.png) [@Christopher\_Geyer](https://community.glideapps.com/u/Christopher_Geyer)\
**Post date:** [February 18, 2024, 3:13pm UTC](https://community.glideapps.com/t/tracking-staff-leaves/70932/2 "2024-02-18T15:13:19Z")

</div>

Hey, welcome to the forum.

Ultimately you describe 2 cases:

1. Absence on a particular day

2. Absence over a long period of time - from date A to date B

So you need 1 and/or 2 date columns in your absence documentation.

Have you already familiarized yourself with the basics?

For example:

Data & layout  
Forms  
Relations

If not, take a look here:

> **[Glide](https://www.youtube.com/@glideapps)**
>
> Build powerful apps and tools without code.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [February 18, 2024, 6:13pm UTC](https://community.glideapps.com/t/tracking-staff-leaves/70932/3 "2024-02-18T18:13:01Z")

</div>

> [@Aashi\_Maheshwari](#):
>
> I am unable to add a date segment for the employer to mark the employee as absent. I want the employer to be able to select a single date or in bulk if it was a longer week.

You’ll want to create a form that writes to an attendance (absent) log. Record the employee (email or id), start date time and end date time (could be same date). In the log table, use the Date Difference tab to determine number of hours/days in that range.

> [@Aashi\_Maheshwari](#):
>
> correspondingly deducts the pay if they have exceeded the number of fixed leaves.

Create a multiple relation column in your employees table that relates their email/id to the email/id column in the log.

If you’re trying to roll up the number of hours in the current year, then you’ll want to add a math column in the employee table that gets the year of the now date (year(now)) and a similar math column in the log table (referencing the start datetime). This assumes that the employee leave bank is January → December.

Then, add a query column through the relation that matches the now year to the start date year to only reference log entries from this year.

Finally, add a rollup column (through the query) that sums the hours/days from the date difference column. Subtract this number from the employee leave bank value (presumedly located in the employee table) to get the remaining balance.
