Traversing 3 Data Tables with a Where Clause

Hi All,

Moving a comment from video 34 on youtube

Suppose I want to show data in a select component from Table A but I want to only show options available based on a where clause in table C using table B as a common 1:1 relationship between the two. What does the where clause in the block need to look like?


Could you please rewrite the following with non-technical (sort of English) language:

“based on a where clause in table C using table B as a common 1:1 relationship between the two.”

For example: “where property name of Customer is… and something in Product is … or relates to…”.

This will help in structuring the query. What would be even better if you could reference the tables from the video in your example .


Sure thing. In my example I have 3 tables Brand, Contract, & Warehouse. Brand & Warehouse are not connected to one another, but are connected to the Contract table in a 1:1 Relationship.

Brand & Contract are connected via the Brand_Name Property and Warehouse & Contract are connected via the Warehouse_Name property. Obviously there are other properties associated with each table but let’s assume we have Brand_City in the Brand table and Warehouse_Type in Warehouse.

The action I would like to do is to write a query where I am searching for a specific value in Brand_City (let’s suppose Cleveland) and returning the Warehouse_Type.

Could you please attach a screenshot of the schema from the visual modeler?

Sure, here it is.

Hi Aaron,

Need help in understanding what you’d like to get. I am missing the following:

  1. There is no Brand_City column in the Brand table
  2. I do not see the Warehouse or Contract tables
  3. I see Storage_Type in Fullfillment_Center, is this what you refer to as Warehouse_Type ?


Hey Mark,

My apologies, I was trying to use a hypothetical example instead of the actual example with the Schema that was sent over. What I’m actually trying to do is to return the fulfillment city from the Brand. The relevant Table/Columns I would use would be

Brand/ brand_name
Fulfillment Center/ fulfillment_center_city

Here’s a query that gets fullfillment center city for a brand:

The where clause is:

Fulfillment_Contract[FC_Name].Brand_Name.brand_name = 'The Flex Company'