My table “Calendar form” has a virtual column [Status], an enum type where it will serve only as an indicator/condition. Since this table has a slice, users will only see their rows/entries.
I plan to have 5 values for this column where:
UPCOMING - [Date] is before and during TODAY() but [Time] is before TIMENOW()
HAPPENING - if Date is TODAY() and TIME is TIMENOW() and the remaining time of TODAY()
DONE - Date is yesterday and Time is midnight
RESCHEDULE - if row is edited and edited rows require Approval (so it is transferred to another table), should also be both approved by TL and Manager. When approved, it will set back to UPCOMING
CANCELLED - if [Route Code] aligned is REJECTED from TL approval or Manager approval
My formula is this:
IFS(
AND([Date] > TODAY(), [Time] >= TIMENOW()), “UPCOMING”,
AND([Date] = TODAY(), [Time] <= TIMENOW()), “HAPPENING”,
AND([Date] < TODAY(), [Time] = “12:00 AM”), “DONE”,
AND(
ISNOTBLANK([_THISROW_BEFORE].[Date]),
ISNOTBLANK([_THISROW_BEFORE].[Time]),
OR(
[_THISROW_BEFORE].[Date] <> [Date],
[_THISROW_BEFORE].[Time] <> [Time]
)
), “RESCHEDULE FOR APPROVAL”,
OR(
LOOKUP([_THISROW].[Route Code], “Team Leader Approval”, “ID”, “Team Leader Approval Status”) = “REJECTED”,
LOOKUP([_THISROW].[Route Code], “Manager Approval”, “ID”, “Manager Approval Status”) = “REJECTED”
), “CANCELLED”
)
Here’s the problem, when I add rows, [Status] sets to RESCHEDULE even when row is new or unedited. Also, the table should not see the rows that has [RESCHEDULE] or [CANCELLED] on it. tnx.