Question
David E Nelson · Jun 2, 2016

Filtering a Filter

What would be the easiest or best way to filter the options presented by a filter control?

For example, suppose that I create a query using HoleFoods that uses a named filter to filter the product categories according to some criteria. When I display the query on the dashboard, I would like to provide a filter control that will allow users to further constrain the product categories. However, a simple filter control will display all the product categories available in the cube many of which are irrelevant to the current query.

Thanks for your help!

0
0 293
Discussion (3)1
Log in or sign up to continue

Hello David,

I wanted to suggest to use the DependsOn feature (see http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...) but I noticed that that does not work with named filters.

For example, say that your pivot table based on HoleFoods filters on a named set which selects a single City, and you defined in Architect/Studio dependsOn="[Outlet].[H1].[City]" for the Product Category level of holeFoods. An applyFilter control on Product Category still show all the members for Product Category. 

Thank you Alessandro.

Unfortunately, in this case I have a named filter, so as you noted  dependsOn won't work. Also, I cannot edit the cube.

I think maybe a pivot variable populated by a KPI might work, but that seems a bit complicated. 

Hi David,

By default, this happens when items are in a hierarchy. For example, if you have Product Category and Product Name as filters and you filter on the Pasta Category, only the Product Names in the Pasta Category will be available to select from. If two levels are not in the same hierarchy but you would like the same behavior, you can use the "Depends On" property of a level. This property can be found on the Architect Management Portal Page in the right side pane after clicking on a level. After setting this property and compiling, a Build will need to be done. This is because using the "Depends On" property will create a new index to quickly determine which members should be displayed when using a filter control.

After this behavior is understood, you may wish to add hidden filters to your widget with default values. For example, I could set Pasta as my Default Value for my hidden Product Category filter. When I try and select a value from my Product Name filter, I only get my different Pasta names as options.