How_to_Add_a_Context_Filter
How_to_Add_a_Context_Filter
STEP 1: Assume that we have a Crosstabs view of Sales for States and Cities
HOW TO ADD A CONTEXT FILTER
STEP 2: Consider that we want to identify the Top 10 Cities in California State by Sales
Drag and drop the State to the Filters shelf
HOW TO ADD A CONTEXT FILTER
STEP 3: "Filter[State]" dialog box will appear
Click None
HOW TO ADD A CONTEXT FILTER
STEP 4: Select California
Click OK
HOW TO ADD A CONTEXT FILTER
STEP 5: Ensure that the State: California is now present in the Filters shelf
HOW TO ADD A CONTEXT FILTER
STEP 6: Drag and drop the City to the Filters shelf
HOW TO ADD A CONTEXT FILTER
STEP 7: "Filter[City]" dialog box will appear
Click Top option
HOW TO ADD A CONTEXT FILTER
STEP 8: Select the By Field option
HOW TO ADD A CONTEXT FILTER
STEP 9: Select Top (default option)
Enter the required number in this example it is 10
HOW TO ADD A CONTEXT FILTER
STEP 10: Select Sales as the field from the drop-down
HOW TO ADD A CONTEXT FILTER
STEP 11: Select Sum (default option) as the aggregation
Click OK
HOW TO ADD A CONTEXT FILTER
STEP 12: Ensure that the City is now present in the Filters shelf
But the problem is that we are seeing only 3 cities in California
state while we needed the Top 10 cities by Sales
HOW TO ADD A CONTEXT FILTER
STEP 13: Right-click the State: California pill in the Filters shelf
and select the Add to Context option
HOW TO ADD A CONTEXT FILTER
STEP 14: Ensure that the State:California pill is gray now.
This is the context filter for this view.
Now we get the Top 10 Cities in California State by Sales