FilterFunctionValue Property
Returns or sets a Variant representing the value used to filter a field. The type of value will vary based on the current setting of the FilterFunction property. Use the following table to determine an appropriate value for this property. Read/write.
FilterFunction setting | Appropriate value range |
---|---|
plFilterFunctionBottomCount | Integer value representing how many of the bottom members that you want to display. |
plFilterFunctionBottomPercent | Double value between 0 and 1 representing the percentage of members that you want to display. |
plFilterFunctionBottomSum | |
plFIlterFunctionNone | |
plFilterFunctionTopCount | Integer value representing how many of the top members that you want to display. |
plFilterFunctionTopPercent | Double value between 0 and 1 representing the percentage of members that you want to display. |
plFilterFunctionTopSum |
expression.FilterFunctionValue
expression Required. An expression that returns a PivotField object.
Example
This example applies a conditional filter to the Store City field based on the Profit total. The three most profitable stores are displayed.
Sub TopThreeStores()
Dim ptView
Dim ptConstants
Dim fldFilterField
Set ptConstants = PivotTable1.Constants
' Set a variable to the active view of the PivotTable list.
Set ptView = PivotTable1.ActiveView
' Set a variable to the field that is to be filtered.
Set fldFilterField = PivotTable1.ActiveData.RowAxis.Fields("Store City")
' Filter the stores based on profit.
Set fldFilterField.FilterOn = ptView.Totals("Profit")
' Set the function used to filter the stores.
fldFilterField.FilterFunction = ptConstants.plFilterFunctionTopCount
' Display the three most profitable stores.
fldFilterField.FilterFunctionValue = 3
End Sub