Search for Start Date < Today() for AirBnB bookings


I’m attempting to access the sum of days that are locked in for an AirBnB. I used this formula to request only today and before:

if([Bookings Calendar].Filter([Start Date]<= Today()),[Bookings Calendar].Filter(Location=thisRow.Location).[Total Nights].Sum(),0)

I am making a separate table that takes these values and sums them to get totals from the calendar table. This Income table will then show how many days are registered and how many are completed and multiply the nightly fare, respective to location, by the number of nights to create projected and actual income totals.

Any help is greatly appreciated!

I think I fixed it.

[Bookings Calendar].Filter([Start Date]<= Today() AND Location=thisRow.Location).[Total Nights].Sum()

That gets me the data I need. Maybe this is helpful to another newb like me? Otherwise, this can probably be closed.

great to see you fixed it @Andrew_Hanson
we often hear an inner voice that goes as you wrote first If this, then that. however mostly it is about filters as you noticed and not about an If statement. Our inner voice does not always correspond with Coda functions or (low) code software in general.
you can click on solution in your second post!

1 Like

Thanks for the info! I’m attempting to realign how I normally approach coding and simplify to the concepts that Coda works with. I’m loving it so far!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.