Automatically link two tables
Hi I have a table with the pricing of multiple holiday names and their prices based on age, e.g. <1, 1-5, 6-10.. The Pricing table is a child table of the Holiday table so the names are already linked.
Then in another table I have guest bookings which calculates their age based on their date of birth. They are also a child table of holidays and as such are linked to the correct holiday.
How can I get Ninox to assign a price by looking at which holiday they are in and which age bracket they're in using the Pricing table.
Thanks
2 replies
-
You don't explain how the "Pricing" table is organized. Let's suppose that it has two fields: "To" is the last age at wich a price is applicable, and "Price" is the corresponding price. For simplicity, let's say that the "Guests" table has an "Age" field. The formula to compute the price for given guest could then be:
let myAge := Age;
first((Holyday.Pricing[To >= myAge] order by To).Price)
-
Thank you, this has worked perfectly!
Content aside
- 3 yrs agoLast active
- 2Replies
- 413Views