Relationships
How to define relationships between queries to build a data model in Kogenta Connect dashboards.
Relationships let you link queries together so you can use columns from one query in widgets bound to another - without writing any joins yourself.
Why use relationships
Imagine you have three workflow queries in your dashboard:
- stores - columns:
store_id,store_name,region - products - columns:
product_id,product_name,category - sales - columns:
store_id,product_id,amount,date
The sales query has the transaction data, but it only contains IDs - not the store name or product name. By defining relationships:
- Link sales → stores on
store_id - Link sales → products on
product_id
Now when you configure a widget bound to the sales query, you can also select store_name and region from stores, and product_name and category from products. The columns from related queries appear in the column picker grouped by query name.
This means you can build a table showing store_name, product_name, amount, and date - all from a single widget, without modifying any workflow.
Chaining relationships
Relationships can chain through intermediate queries. For example:
- order_lines → orders (on
order_id) - orders → customers (on
customer_id)
A widget bound to order_lines can access columns from orders and also from customers, because there is a path through orders. This lets you build rich data models where dimension tables are linked through shared keys.
Defining a relationship
- Open the dashboard in the builder
- Click the Relationships button in the toolbar
- Click create to add a new relationship
- Select the two queries you want to link
- Select the join columns - click column headers in the data preview, or choose from the dropdown
- Choose the filter direction
- Save the relationship
Each relationship connects a column in one query to a column in another, with a many-to-one cardinality. The "from" side has many rows for each row on the "to" side - like many sales rows (fact) for each store (dimension).
Filter direction
Each relationship has a filter direction that controls how cross-filtering propagates:
| Direction | Behavior | Typical use |
|---|---|---|
| Single | Filters flow from the dimension side to the fact side only | Selecting a store filters sales, but selecting a sale does not filter stores |
| Both | Filters flow in both directions | Full interactivity between both queries |
Single direction is the standard choice for fact/dimension relationships. Bidirectional is useful when you want selecting data in either query to filter the other.
Multiple relationships
A dashboard can have many relationships, connecting multiple queries into a star schema or other data model pattern. For example, a sales fact query at the center with relationships to stores, products, dates, and customers dimension queries - giving every widget access to descriptive columns from all dimensions.
Managing relationships
The relationships dialog shows all defined relationships with their connected queries and columns. From here you can:
- Toggle active/inactive - temporarily disable a relationship without deleting it
- Edit - change the connected columns or filter direction
- Delete - remove a relationship entirely