Allow aggregation of grouped containers, in addition to selection, sorting and grouping.
This behaves like #select(String, String, String) but additionally groups the container by one or more
fields and computes aggregate values (for example a sum or count) over each group. An optional having
clause filters the resulting aggregated rows.
Example: params.aggregate("SUM contract_rate contract_sum, COUNT contract_rate count", "primary_ccy==GBP", "buy_sell,primary_ccy", "contract_sum DESC NUMBER", "number:contract_sum>123")
The static ContainerFilterFactory can be used to build a FilterExpression whose
toFilterString method will generate a where or having clause in the required format.
Note: this method will only work if the backend has the Caplin Refiner installed.
The aggregate clause, a comma separated list of "function field alias" tuples, where
function is the aggregation to apply (SUM, MEAN or COUNT), field is the field to
aggregate (using * if the function is COUNT) and alias is the name given to the aggregated
result. Example: "SUM contract_rate contract_sum, COUNT * count".
The where clause, in the form required by Caplin Refiner (example 'bid>123&ask<222').
The group by clause, a comma separated list of fields to group by, in the form: field [,field] example: buy_sell,primary_ccy
The sorting order of the returned container in the form: field [ASC or DESC] [NUMBER or TEXT], ... example: contract_sum DESC NUMBER
The having clause applied to the aggregated results, in the form required by Caplin Refiner (example 'number:contract_sum>123').
The update ContainerSubscriptionParameters object to permit a fluent programming style.
Allow selection, sorting and grouping of containers.
Example: params.select('bid>123&ask<122', "bid ASC NUMBER, ask DESC NUMBER", "bid" )
The static ContainerFilterFactory can be used to build a FilterExpression whose
toFilterString method will generate a where clause in the required format.
Note: this method will only work if the backend has the Caplin Refiner installed.
The following example shows how to build an expression for FIELD1 > 0.1 AND FIELD3 = "a a"
var exp1 = ContainerFilterFactory.create("FIELD1", FilterExpressionOperator.GREATER_THAN, "0.1");
var exp2 = ContainerFilterFactory.create("FIELD3", FilterExpressionOperator.EQUAL, "a a");
var exp1Andexp2 = ContainerFilterFactory.createLogical(FilterExpressionLogicalOperator.AND, exp1, exp2);
var subscription = streamLink.subscribe("/container", subscriptionListener,
{"select":
{
"where": exp1Andexp2.toFilterString(),
"orderby": "FIELD1"
}
});
The where clause, in the form required by Caplin Refiner (example 'bid>123&ask<222').
The sorting order of the returned container in the form: field [ASC or DESC] [NUMBER or TEXT], ... example: bid DESC NUMBER,ask ASC NUMBER
The group by clause in the form: field example: bid
The update ContainerSubscriptionParameters object to permit a fluent programming style.
Sets the record fields that will be requested when a subscription is made using these parameters.
If no fields are defined, then your SubscriptionListener receives all fields that are available for the subject.
The record fields to be requested.
The updated RecordSubscriptionParameters object to permit a fluent style.
Sets the filter that restricts the the information returned by the subscription. The filtering is performed by the Liberator, rather than the client, so that bandwidth and client side processing are reduced.
For more details on the format of the filter string, please see the Make subscriptions more specific document.
The filter string.
true if the filter should be evaluated on the fields in the cached object (image)
after the update is applied to the image, false if it should be evaluated only on the changed
fields in the record update.
The updated RecordSubscriptionParameters object to permit a fluent style.
Sets the subscription to keep elements in the container that are inaccessible.
The update ContainerSubscriptionParameters object to permit a fluent programming style.
Sets the subscription to provide only the container structure (no constituent images or updates).
The update ContainerSubscriptionParameters object to permit a fluent programming style.
Sets the size of the container window.
The index of the first container element within the window, where the first container element has an index value of 0 (zero).
The maximum number of container elements within the window.
The update ContainerSubscriptionParameters object to permit a fluent programming style.
Generated using TypeDoc
Jsprivate
The
ContainerSubscriptionParametersis passed as a parameter to thesubscribemethod in the StreamLink.Name
ContainerSubscriptionParameters