All documentation
  • API Reference for older versions
  • setFilter

    setFilter(uniqueName: String, filter: FilterObject)

    [starting from version: 1.4]

    Sets the filter for the specified field.

    Parameters

    Parameter/TypeDescription
    uniqueName
    String
    The field’s unique name.
    filter
    FilterObject
    Contains filtering information.
    Note that filter.members, filter.exclude, and filter.include filters do not apply if the field contains one member.

    Examples

    1) If you want to see data for certain field members, specify them in the members property:

    pivot.setFilter("Country", 
    {
    "members": [
    "country.[poland]",
    "country.[uk]",
    "country.[ukraine]",
    ]
    }
    );

    Try the example on JSFiddle.

    2) If you want to hide certain field members, specify them in the exclude property:

    pivot.setFilter("Country", 
    {
    "exclude": [
    "country.[australia]",
    "country.[japan]",
    "country.[norway]",
    "country.[sweden]",
    ]
    }
    );

    Check out the example on JSFiddle.

    See also

    clearFilter
    getFilter