Joins (Collection)

Member of:

DataModel object

Description:

Represents joins between topics in a Data Model.

Tip:

All collections have a method named “Item(NameOrIndex).” This is the default method for all collections and it returns an item in the collection at a particular index or with a specific name. Use brackets ([]) to represent calls to the Item (Method). For example, these statements are identical: myItem = Documents[1] myItem = Documents.Item(1) myItem = Documents["StartUp.bqy"] myItem = Documents.Item("StartUp.bqy")

Example 1:

This example shows how to remove all the joins in the current Data Model and create a simple join between the Wine.Wine_Id and Wine_Sales.Wine_Id topic items:

with(ActiveDocument.Sections["Query"].DataModel)
{
Joins.RemoveAll()
Field1 = Topics["WINE"].TopicItems["Wine Id"]
Field2 = Topics["WINE_SALES"].TopicItems["Wine Id"]
//Create a new join by joining two TopicItems together
Joins.Add(Field1,Field2,bqJoinSimpleEqual)
}

Example 2:

This example shows how to add a join between two tables:

// add join between PCW_PERIODS (Day) and PCW_SALES (Order_Date)
PCWPeriods_Day = PCWPeriods.TopicItems["Day"]
PCWSales_OrderDate = PCWSales.TopicItems["Order_Date"]
Day_OrderDate_Join = ActiveDocument.Sections["DataModel"].DataModel.Joins.Add(PCWPeriods_Day,PCWSales_OrderDate,bqJoinSimpleEqual)

Methods:

Function Add(TopicItem1 As TopicItem, TopicItem2 As TopicItem, Type As BqJoinType) As Join, Function Item(NameOrIndex) As Join, RemoveAll()

Properties:

Read-only: Property Count As Number