Defined join paths are customized join preferences that enable you to include or exclude tables based on items referenced on Request and Limit lines. This limits the query to tables based on available groupings; generating the most efficient SQL for Data Model queries. The features in this collection correspond to Define Join Paths dialog box options.
All collections have a method named “Item(NameOrIndex).” This is the default method for all collections and 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") |
This example shows how to select a user defined join path option and delete the join path:
ActiveDocument.Sections["Query"].DataModel.JoinsOptions.Type= bqDataModelJoinsOptionDefJoin ActiveDocument.Sections["Query"].DataModel.JoinsOptions.DefinedJoinPath ["MyJoinPath"].Remove()
This example shows how to select the user defined join path option, and change a defined join path by adding a join path topic:
ActiveDocument.Sections["Query"].DataModel.JoinsOptions.Type= bqDataModelJoinsOptionDefJoin ActiveDocument.Sections["Query"].DataModel.JoinsOptions.DefinedJoinPath ["MyJoinPath"].AddTopic("Periods")
This example shows how to select the user-defined join path option, create a defined join path, and add all join path topics to the defined join path:
ActiveDocument.Sections["Query"].DataModel.JoinsOptions.Type= bqDataModelJoinsOptionDefJoin ActiveDocument.Sections["Query"].DataModel.JoinsOptions.DefinedJoinPath.Add ("MyJoinPath") ActiveDocument.Sections["Query"].DataModel.JoinsOptions.DefinedJoinPath ["MyJoinPath"].AddAllTopics()
Add(DefinedJoinPath as String), Item (NameOrIndex as Value), Remove(NameOrIndex As String), RemoveAll()