Join data items across related tables
Related data items let you project fields from multiple tables into one result. The link and join type determine which rows survive, so verify both against the relationship cardinality in your data.
Link parent and child data items
Place the related table as a lower, child data item and define DataItemLink on that child. The link compares a field from the child table with a field from an ancestor data item. For example, a customer ledger entry links its Customer No. field to the parent customer's No. field.
DataItemLink supports equality links between fields. It doesn't support FlowFields or FlowFilters as link fields. If the data model needs a different condition, design the query or consumer around supported fields instead of assuming the link accepts an arbitrary expression.
Choose a join and check its cardinality
An inner join returns parent rows with matching child rows. A left outer join preserves parent rows without a match and returns blank child values. A right outer join preserves unmatched child rows, and a full outer join preserves unmatched rows from both sides. A cross join has no link and pairs each row on one side with every row on the other side.
Before choosing a join, ask which unmatched records the result must include. Then check whether each parent can match multiple children. A one-to-many relationship repeats parent values for each child. If a later aggregate sums a parent-side measure, those repeated rows can inflate the total.
For details, see Data Item Links and SqlJoinType property.