Hello AppSheet Community! 
Iβm building a Compensatory Leave and Overtime
Management application for an industrial company
and need expert help with complex business logic.
βββββββββββββββββββββββββββββββ
APP STRUCTURE:
Tables:
β’ Employees
β’ CompensatoryLeave
-
ID (Key) β format: LCM-DR-26-001
-
EmployeeID (Ref β Employees)
-
Date
-
Days
-
Reason
-
CreatedBy (USEREMAIL())
-
Requisition (File/PDF)
-
Status (Pending/SectorManager Approved/DRH Approved/Rejected)
-
SectorManagerApproval
-
DRHApproval
-
ApprovedDate
β’ OvertimeRequests (NEW)
-
ID (Key)
-
EmployeeID (Ref β Employees)
-
Date
-
StartTime
-
EndTime
-
OvertimeHours (auto-calculated)
-
OvertimeType (50% or 100% - auto-calculated)
-
CompHours (auto-calculated)
-
CompDays (auto-calculated)
β’ LeaveBalance
-
EmployeeID (Key)
-
Balance (Virtual Column)
β’ Holidays
βββββββββββββββββββββββββββββββ
SECURITY LOGIC:
Each Manager sees ONLY their employees:
Security Filter on CompensatoryLeave:
IN([EmployeeID],
SELECT(Employees[EmployeeID],
\[Manager Email\] = USEREMAIL()
)
)
Dropdown filtered by Manager:
Valid If on EmployeeID:
SELECT(Employees[EmployeeID],
[Manager Email] = USEREMAIL()
)
βββββββββββββββββββββββββββββββ
WORKFLOW (already working):
Manager adds compensatory leave
β Email notification
SectorManager approves/rejects
β Email notification
DRH approves/rejects
β Balance updated automatically
βββββββββββββββββββββββββββββββ
ISSUE 1 β Custom Sequential ID:
I need IDs in this format: LCM-DR-26-001
β’ LCM = site name (fixed)
β’ DR = Demande de RΓ©cupΓ©ration (fixed)
β’ 26 = current year last 2 digits (automatic)
β’ 001 = sequential number per year
I tried:
βLCM-DR-β & TEXT(YEAR(TODAY())-2000,β00β)
& β-β & TEXT(COUNT(SELECT(
CompensatoryLeave[ID],
YEAR([Date])=YEAR(TODAY())
))+1,β000β)
Is this correct? Any better approach?
βββββββββββββββββββββββββββββββ
ISSUE 2 β Overtime Auto-Calculation:
Business Rules:
β’ ONLY Type1 employees are eligible
(SundayβThursday, 08:00β16:30)
β’ Cadre, Type2, Type3 = NOT eligible
50% Overtime hours:
β’ SundayβThursday: 16:30β21:00
β’ SundayβThursday: 05:00β08:00
β’ Saturday: 05:00β21:00
100% Overtime hours:
β’ Every day: 21:00β05:00
β’ Friday: all day
β’ National & Religious holidays: all day
Compensation calculation:
β’ 50% β 1 hour worked = 1.5 hours compensation
β’ 100% β 1 hour worked = 2 hours compensation
β’ 1 working day = 8 hours
β’ Minimum entry = 0.5 hour
Example:
4 hours at 100% = 8 compensation hours = 1 day off
Input by Manager:
β’ Date
β’ Start Time
β’ End Time
β App calculates everything automatically
My formula for OvertimeType:
IF(
OR(
WEEKDAY(\[Date\]) = 6,
IN(\[Date\], Holidays\[Date\])
),
β100%β,
IF(
AND(
MOD((\[StartTime\]-0.875)\*24,24) >= 21,
MOD((\[EndTime\]-0.875)\*24,24) <= 5
),
"100%",
"50%"
)
)
Questions:
1. Is this formula correct for time comparison
in AppSheet?
2. How to handle shifts that cross midnight
(e.g., 22:00 β 03:00)?
3. How to split mixed shifts automatically?
(e.g., 18:00β23:00 = 2.5h at 50% + 2h at 100%)
βββββββββββββββββββββββββββββββ
ISSUE 3 β Hide fields in Form View only:
I want to hide these fields ONLY in Form View
(hide when adding, show in Detail View):
β’ Status
β’ SectorManagerApproval
β’ DRHApproval
β’ ApprovedDate
I used Show_If = FALSE but this hides them
everywhere. How to show them only in Detail View?
βββββββββββββββββββββββββββββββ
ISSUE 4 β Balance Virtual Column:
Iβm using this formula in LeaveBalance table:
SUM(SELECT(CompensatoryLeave[Days],
AND(
\[EmployeeID\] = \[EmployeeID\],
\[Status\] = "DRH Approved"
)
))
Is Virtual Column the best approach or should
I use Automation Bot to update the balance?
βββββββββββββββββββββββββββββββ
Additional Info:
β’ Data source: Google Sheets
β’ Users: ~50 managers + sector managers + DRH
β’ Platform: Mobile + Desktop
β’ Industry: Industrial/Manufacturing (Holcim)
βββββββββββββββββββββββββββββββ
Any help would be greatly appreciated! 
Thank you in advance.