Complex Select/Filter using 3 Data Masters

Russell Hutson shared this question 7 years ago
Answered

Hi


I have two data masters: Customers and Orders.


Each have an id column.


I have a third datamaster called CustomerOrdersMap, which maps the Orders to Customers like this:


customerid=1


orderid=2


customerid=1


orderid=3


customerid=2


orderid=1


So customer 1 has two orders.


I'd like to update an Orders Data Grid when a customer is selected (e.g. using an input called customerIdInput) as follows (in SQL)


SELECT * FROM Orders WHERE orderid IN (SELECT orderid FROM CustomerOrdersMap WHERE customerid=customerIdInput)


How can I do that using SELECT / FILTER etc?


Thanks


Russell

Comments (3)

photo
1

Wow, you are going so far with Prototyper! That's cool! Well, I've been able to build the expression you need to simulate that. It's quite complex so I think the best is to show it to you in a prototype so you can see how it works http://justinmind.s3.amazonaws.com/n_...

photo
1

Thank Victor! It worked!


I didn't think of using the 'has' function, ...that was the key.


For others reading this in a hurry....


75832011ce2eaa7b442ff00931ce9a17

photo
1

You're welcome!