SpreadJS 15
Formula Reference / Formula Functions / Lookup and Reference Functions / REMOVEFILTERS
In This Topic
    REMOVEFILTERS
    In This Topic

    This function can be used to expand the group context when summarizing at the group level of a TableSheet. This function selects the context of the upper group level.

    Syntax

    =REMOVEFILTERS ([ group_field_string [, group_field_string [, … ] ] ])

    Arguments

    This function has these arguments:

    Argument Description
    [group_field_string] [optional] The group field indicates the scope that is expanded to. The group fields should be from the current group level to upper group level. All records are expanded to if nothing is passed.

    Remarks

    The REMOVEFILTERS function should only be used within the CALCULATE function as a parameter.

    Data Types

    Returns a string value.  

    Examples

    The following sample code show the basic usage of the REMOVEFILTERS function.

    JavaScript
    Copy Code
    sheet.groupBy([
        {
            caption: "Ship Via", field: `ShipVia`, width: 160,
            summaryFields: [
                {
                    caption: "Ratio of Year Quarter", width: 170, style: { formatter: "0.00%" },
                    formula: `=SUM([Freight]) / CALCULATE( SUM([Freight]), REMOVEFILTERS("ShipVia"))`, // ratio of sum of freight under freight level to sum of freight under ship name
                }
            ]
        }
    ])