AggregateLimits collection, Limits collection
Creates a stand-alone limit object. After creating the limit, complete its properties before adding it to the limits collection.
Expression.CreateLimit(limitItem As String) As Limit
The argument for CreateLimit method varies for regular, computed item, and aggregate limits. For regular limits the argument is a reference to the table topic and the topic item (e.g. CreateLimit(“Sales_Facts.Amount_Sales”)). For computed item and aggregate limits, the argument is a reference to the item Display Name on the request line (e.g. CreateLimit(“Request.Amount Sales”)). |
An expression that returns a Limits object
This example shows how to create a Results limit. When you create a local (Results) limit, the value for the LimitItem parameter needs to be the name of the column the limit is being applied:
MyLimit = ActiveDocument.Sections["Results"].Limits.CreateLimit("State") MyLimit.Operator = bqLimitOperatorEqual MyLimit.CustomValues.Add("CA") MyLimit.SelectedValues.Add("CA") ActiveDocument.Sections["Results"].Limits.Add(MyLimit) ActiveDocument.Sections["Results"].Limits[1].DisplayName = "State" Expression Required:
This example sets the FROM clause and the WHERE clause, processes the query, and then restores the original SQL statement:
//Set the FROM clause, Set the WHERE clause, PROCESS, and then RESET SQLActiveDocument.Sections["Query"].CustomSQLFrom("FROM From.Sales_Fact, From.Periods, From.Products") ActiveDocument.Sections["Query"].CustomSQLWhere("WHERE (Periods.Day_Id=Sales_Fact.Day_Id AND Products.Product_Id=Sales_Fact.Product_Id) AND (Periods.Quarter='Q1')") ActiveDocument.Sections["Query"].Process() ActiveDocument.Sections["Query"].ResetCustomSQL();