Example of Value Filtering in Blazor Pivot Table Component
This sample demonstrates filtering row and column headers based on a specific measure and the grand total. The different conditions that can be applied to the grand total are equals, less than, greater than, between, etc.
Grand Total |
---|
Grand Total | No records to display |
Fields:
|
|
Measures:
|
|
Condition:
|
|
Value 1:
|
|
In this sample, any field can be selected from the Fields dropdown list along with value field from Measures dropdown list to filter. Further, choose an option from the Conditions dropdown list, enter the values in Value1 and Value2 input textbox and apply the same to view the field headers filtered based on the grand total.
Value filtering can be applied either through code-behind or UI. To achieve this in code-behind, set the AllowValueFilter property in PivotViewDataSourceSettings to true and use the PivotViewFilterSetting in the pivot table along with the following properties.
Name : | Specifies the normal field. |
Type : | Specifies the filter type and it should be "Value" in this scenario. |
Measure : | Specifies the value based field. |
Condition : | Specifies the operator type like equals, greater than, less than, etc. |
Value1 : | Gets the value to view the filter result. For example, select "DoesNotEquals" and enter "9590" to exclude the grand total with this value. |
Value2 : | For conditions like "between" and "not between", this option will be enabled. Enter both start and end value to view the filter result. For example, enter "9590" and "17500" to filter the grand totals within this range. |
To achieve value filtering through UI, navigate to "User Interaction > Field List" sample and open the filter dialog to experience the same. For API details, refer to the "Field List" sample description.
More information on the value filtering feature can be found in this documentation section.