Select items for reference they are not in a list

Dear Community,
my head bursts because of a probably very simple problem:

I have two tables: Booking and a lookup table Rooms.

I want the Booking table to show only those rooms in the selection that are not already included (i.e. booked) in the Booking table on a specific day at a specific hour.

I have already managed to display all rooms that are booked on that day at that hour. How can I now limit the selection in the lookup table accordingly?

My code for filtering (date and hour) looks as this:

Booking.Filter([Flur-Date]=thisRow.[Flur-Date] and Contains(TimeRange,thisRow.TimeRange) and rowID!=thisRow.rowID).Room

All rooms that have already been booked are displayed. How can I now display the remaining rooms, i.e. those rooms that are not in the filtered list and therefore still available?

I am very grateful for any help!
With best regards
F. Hoffmann-Samaga

Dear @Franko_Hoffmann-Samaga, welcome to the community!

I recommend to post a dummy copy of your doc, for the community to check the problem.

You might like also this related post for inspiration:

With pleasure:

Well I solved the problem with a clear head this morning by using a Filter-Expression in the LookUp-Column :wink:

SwitchIf(Count(thisRow.[K-übrig])=0, Room_ID.Find("In") != -1 ,Count(thisRow.[K-übrig])=3, (Room_ID.Find(ToText(thisRow.[K-übrig].Nth(1))) != -1 or Room_ID.Find(ToText(thisRow.[K-übrig].Nth(2))) != -1 or Room_ID.Find(ToText(thisRow.[K-übrig].Nth(3))) != -1), Count(thisRow.[K-übrig])=2, Room_ID.Find(ToText(thisRow.[K-übrig].Nth(1))) != -1 or Room_ID.Find(ToText(thisRow.[K-übrig].Nth(2))) != -1, Count(thisRow.[K-übrig])=1, Room_ID.Find(ToText(thisRow.[K-übrig].Nth(1))) != -1)

Many thanks for your sympathy.

1 Like