Enables you to use local results in joins, and the Request line for processing results sets.
All collections have the “Item(NameOrIndex)” method. This is the default method for all collections that returns collection items at a particular index or by 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 adds a local results topic to a query section:
vDM=ActiveDocument.Sections["Query"].DataModel.Catalog.Results.Item(1)ActiveDocument.Sections["Query"].DataModel.LocalResults.Add(vDM) or vDM= ActiveDocument.Sections["Query"].DataModel.Catalog.Results.Item("sales_fact") ActiveDocument.Sections["Query"].DataModel.LocalResults.Add(vDM)
This example shows how to remove all local results topics and count the local results topics in a query section:
ActiveDocument.Sections["Query"].DataModel.LocalResults.RemoveAll() ActiveDocument.Sections["Query"].DataModel.LocalResults.Count
This example removes a single local results topic and gets the topic item count of the “Results2” local topic:
ActiveDocument.Sections["Query"].DataModel.LocalResults["Results2"].Remove() ActiveDocument.Sections["Query"].DataModel.LocalResults["Results2"]. LocalResultsTopicItems.Count
This example shows how to add a join between a topic and a local results topic:
Topic1=ActiveDocument.Sections["Query"].DataModel.LocalResults["Sales Fact"]. LocalResultTopicItems.Item("Store Id") Topic2=ActiveDocument.Sections["Query"].DataModel.Results["Results2"].TopicItems.Item("Store Id") ActiveDocument.Sections["Query"].DataModel.LocalJoins.Add(Topic1,Topic2, bqJoinLeft)
This example shows how to remove a single local results topic:
//Remove a single Local Results Topic ActiveDocument.Sections["Query"].DataModel.LocalResults["Results2"].Remove()
This example shows how to get a topic item count of local results:
//Get the Topic Item count of Local Results TextBox1.Text=ActiveDocument.Sections["Query"].DataModel.LocalResults["Results2"].LocalResultsTopicItems.Count
This example shows you to get a count of local joins in a query section:
This example shows how to remove all local joins:
This example shows how to add a join between a topic and a local results topic:
//Add Join between Topic and Local Results Topic Topic1=ActiveDocument.Sections["Query"].DataModel.LocalResults["Sales Fact"].LocalResultTopicItems.Item("Store Id") Topic2=ActiveDocument.Sections["Query"].DataModel.Results["Results2"].TopicItems.Item("Store Id") ActiveDocument.Sections["Query"].DataModel.LocalJoins.Add(Topic1, Topic2,bqJoinLeft)
This example shows how to add a topic from local results to the Request Line:
//Add Topic from Local Results to Request Line ActiveDocument.Sections["Query"].Requests.Add("Results2","Quarter")
Add(LocalResultObject As DMResult), Item(NameOrIndex) As LocalResult, RemoveAll()