Hello everyone,
I'm currently pondering over a filter function that's difficult for me and I'm hoping someone can help me.
To the background:
I have two lists:
1. Parking spaces: All parking spaces are listed here
2. Reservations: The dates defined for the parking spaces are saved here.
So that only the parking spaces available on a given day are displayed in the list, I have defined the following filtering above the corresponding gallery:
Filter(Parkplätze;Not(Parkplatznummer in Filter(Reservierungen;Startzeit>=startTime && Endzeit <=endTime||Startzeit<=endTime &&Endzeit>=startTime).Parkplatznummer ||'Aktiv?'="Nein"))
startTime and endTime are global variables where I store the selected dates and times to compare with the dates and times stored in the "Reservations" list. In addition, I have defined a yes/no column "Active" in the "Parking spaces" list, which searches for whether a parking space has been set to active. This is the final part of the filtering and it has worked very well so far.
Now a new function will be added: There will be parking spaces that are only available at certain times. To do this, I defined the “Start” and “End” columns in the “Parking spaces” list.
According to an example, the filtering should work as follows:
I have a P1 parking space that is only available from April 1st, 2024 to April 5th, 2024. All other parking spaces that have not yet been reserved should be displayed by April 1st, 2024. From 01.04. until April 5th The parking lot P1 will then also be displayed. And if April 6th. then P1 should no longer be displayed.
How do I expand the filtering so that this additional parking space is shown to me?
Thanks in advance and best regards
Nobody has an idea? 😞 I'm a little desperate...
I almost have it:
Filter(Parkplätze;Not(Parkplatznummer in Filter(Reservierungen;Startzeit>=startTime && Endzeit <=endTime||Startzeit<=endTime &&Endzeit>=startTime).Parkplatznummer ||'Aktiv?'="Nein" ||Beginn>=startTime && Ende <=endTime || Beginn>=endTime &&Ende>=startTime))
The start date is already displayed correctly; However, the end date is still displayed even if a date further in the future is selected. How do I have to adjust the formula above so that the end date can also be filtered correctly?
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional