OLAPFilter (Object)

Member of:

OLAPFilters collection

Description:

Represents an individual filter in the data layout. Only the variable property of a filter may be modified by way of the Object Model. The Dimension and Member properties are read-only. Dimension and Member property values are derived from the current alias table.

Example 1:

This example shows how to read if a filter is a variable or not:

if (Sections["Query"].Filters[1].IsVariable == true) {
    // this is a variable filter
}

// Set the filter to be a variable filter
Sections["Query"].Filters[1].IsVariable = true;

Example 2:

This example shows how to read if a filter has been to set on a member:

if (Sections["Query"].Filters["Product"].Member == "100-20") {
    // There is a filter on the 100-20 member of the Product dimension
}

Example 3:

This example shows to add a filter:

var filters = Sections["Query"].Filters;
if (filters.Count > 0) {
    var filter = filters[1];
    var filterDim = filter.Dimension; // a string containing the dimension name
    var filterMem = filter.Member; // a string containing the member name
} else {
    filters.Add("Product", "100-20");
}

Methods:

Remove

Properties:

Read only: Dimension as String, Member as String, Name as String

Read-write: Ignore as Boolean, Variable as Boolean