Author: Ian Britz
Mapping Filters is a component used to create custom displays with any number of specific filter selections. As Mapping Filters have a high degree of flexibility, there are a variety of use-cases for them. In this article, we'll examine the three most common use-cases:
- Use Case 1: Advanced Filter Display
- Use Case 2: Drive Multiple Filters with Single Selection
- Use Case 3: Custom Sorting for Filters
Configure Mapping Filters
1. In the Modeler, under Application in the right-hand navigation pane, go to All Mapping Filters and choose Add.
2. Enter a name for the Mapping Filter and select Dimensions on which the filter depends.
3. Click Save.
Kepion creates a new table in the database with the following naming scheme:
[dbo].[MF_<Mapping Filter Name>]
The simplicity of the table's structure gives Mapping Filters their flexibility. There is a column for each of the Dimensions we chose and a Display column. To build the Mapping Filter, we simply need to insert records for each combination of Dimension Members, and what should be displayed when they're selected.
Note: There's currently no UI to manage these mappings in Kepion. Please use SQL Server Management Studio (SSMS) to populate your Mapping Filter tables.
Advanced Filter Display
Use Case #1
Let's take a look at a common use case for Mapping Filters: Filter Displays are a way to display the attribute values of a Dimension Member. However, Filter Displays can display information only from a single Dimension. If we want to display values dependent on multiple Dimensions, we need to use Mapping Filters.
For example, businesses with multiple entities, using multiple local currencies, need to consolidate all their data into a single reporting currency. If you want to display an entity's currency as a Filter Display, you would need to know which Entity was selected, and whether we are viewing Local or Reporting Currency.
1. Click Add to create a new Mapping Filter.
2. Select Currency Type and Entity Dimensions for the Filter's dependencies.
3. Open SSMS to insert the records we need. For this configuration, if Reporting Currency is selected, the display is always USD. Otherwise, Entity's currency is displayed.
4. In the Dashboard Editor, right-click and select Add Mapping Filter.
5. Select the Mapping Filter we configured. We also need to associate a Form with the Mapping Filter to drive the relationships between the filters. The No Mapping field allows us to specify what to display if the selected mapping doesn't exist, and the Read-Only option prevents users from using the Mapping Filter to change the filter selections.
With a combination specified, the display should appear as desired:
Drive Multiple Filters with Single Selection
Use Case #2
A powerful facet of Mapping Filters is that they work bidirectionally. While the filter selections can drive what's displayed in the Mapping Filter, the Mapping Filter can also drive the filter selections. The bidirectionality proves particularly useful if you have several interdependent filters.
For example, imagine you have Entity and Customer Filters. If you wanted to examine a particular customer, you'd have to first select the Entity and then the Customer, even though each Customer only belongs to a single Entity. This would be particularly tedious if you had several such layers of Filters that always needed to be selected one at a time.
However, with Mapping Filters, we can drive the filter selections based on the Display Mapping Filter. In the Mapping Filter table below, the Display column is a list of customer names, while the other two columns contain the MemberIds for Entity and Customer Dimension Members.
With the Mapping Filter configured, the correct filter selections update automatically when we select the customer name in the Mapping Filter.
If we were configuring this feature for a large number of filters and wanted to select some manually and auto-fill the rest, we could use the Filter results... section to scope the Mapping Filter by the selected Dimensions. For example, we could have users select the Entity filter first, and then scope the Mapping Filter results to just customers within that entity.
Custom Sorting for Filters
Use Case #3
Another useful feature of Mapping Filters is: the order the records exist in the Mapping Filter table corresponds to the order the options are displayed in Kepion. This allows you to create custom sorts or orderings of Dimension Members in a filter.
In this example, we have a list of customers in the Customer Dimension in no particular order.
1. Create two new Mapping Filters that depend on just the Customer Dimension. One will be used to sort by the Customer ID, and the other will be used to sort by the Customer Name.
2. In the SSMS tables, insert the records sorted by the desired criteria.
3. Replace the normal Customer filter in the Dashboard with a Mapping Filter. The Mapping Filter selection updates the Customer filter behind the scenes.
4. To ensure the Mapping Filters are always sorted correctly, add a Deployment Script similar to the one below:
TRUNCATE TABLE [dbo].[MF_Sort Customer by ID]
INSERT INTO [dbo].[MF_Sort Customer by ID]
WHERE [MemberId] > 0
ORDER BY [Customer Id]
Link Mapping Filters
In the Basic Link tab, you can link a Mapping Filter to filters of other Forms. Filters available to be linked are listed below, and you can enable the link by checking the checkbox.