In the previous example, which extracted balance sheet data there are some unwanted items and we use filter to remove them from output.

The filter is normally applied after parse is over and members are constructed. The Example-5, which loads defs/examples/jsoup/ex-5/job.xml uses filter in row axis and the filter snippet from the dataDef is as below

<axis name="row">
....  
  <filter axis="row">
    <xf:fields>
        <xf:filters type="value">
            <xf:filter name="blank" pattern="" />
            <xf:filter name="f1" pattern="Sources Of Funds" />
            <xf:filter name="f2" pattern="Application Of Funds" />
        </xf:filters>
    </xf:fields>
  </filter>
</axis>

This filter definition remove the members whose row axis value is blank, null or “Sources Of Funds” or “Application Of Funds”. As type attribute is value, pattern is applied to member field.

The attribute type can be value or match. When type=“match” then pattern is applied to member match field instead of value.

 
 

Pattern attribute can be plain text for direct comparison or regex for pattern matching.

When filter is true for an axis then the enclosing member is removed from the output not just the axis.

For example, for col filter pattern is “Dec 16” and member is

Member
Col : Dec 16
Row : Equity
Fact : 20.00

The axis col matches with the pattern and the member is filtered even though row and fact contains values.