Pre-filtering Cognos data
When sourcing data for Datasets, Metrics, Reports, External Reports and Dimensions from IBM Cognos, you can pre-filter data before fetching it. This allows you to focus on the slice of data you need and exclude everything else.
Parameter-based Filters can be added to Cognos Reports and Visualizations.
Below there is an example of a Report in View mode. To get Parameter Names and Values for Filters in Cognos Reports, you need to switch to Edit mode with the corresponding Toggle.
When in the Edit mode, follow the steps described below.
- Click the Data Items icon to open a list of saved Queries
- Selecting the Query will open the Data Items (Report contents) and display the Filter
- Click the Filter name, and on the "Filter condition" pop-up find:
- Parameter name: must be used as an External Filter Name in Metric Insights
- Values: when manually adding External Filter Values in Metric Insights (as described in Step 2.1), copy the Filter Values from here
1. Define a Source Object for Data Collection
Start by creating an element/Dataset. Once you get to the process of Data Collection, define the following:
- Data Source: This is an entity that connects Cognos and Metric Insights. For more information, see: Establish connectivity to Cognos
- Data Collection Trigger: select the Trigger that is going to initiate updating information in this element/Dataset.
- Report: Click Select Element to open the pop-up with the list of available Cognos Reports that can be a source of data.
- Each item in the list is represented as the path (hierarchy) to the respective Report in Cognos. Find the desired report in the list.
- If you do not see the required item, try refreshing the list by clicking the Refresh icon at the upper right corner of the pop-up.
2. Adding Cognos Filters to Metric Insights
Once filters are added to a Metric / Report or External Report for the first time, they are going to be automatically added to all new respective elements with the same Data Source / Report.
- External filters are tied to /Cognos Reports, not Metric Insights' elements. This allows Filters to be reused for multiple elements (there is no need to create new Filters every time an element is created in Metric Insights).
- If there are more External Filters or Filter Values that you would like to use for the current element, you can always set the redundant ones to "ignore".
When creating a Metric / Report / External Report / Dataset fetched from Cognos, after you define the Report that should serve as a Data Source, you may pre-filter information that is going to be fetched.
To pre-filter the data, click [+IBM Cognos Filter]. The following pop-up will give you 3 options to add Filters.
NOTE: Examples given below are taken from the Cognos Report shown at the top of the page.
2.1. Enter manually
Cognos Filter Name: Define the name of the filter from IBM Cognos
- The name of the Filter must exactly match the Parameter Name of a parameter-based Cognos filter
- Filter names are case sensitive. Unless the match is exact, the Filter will not work
- Filter Values: Choose 'Enter Manually' and click Save at the bottom of the pop-up.
- Click [+ Add Value] and in the opened pop-up manually type in the name of the filter value. Save your entry. All added values appear in the Values list.
- Save your entries.
2.2. Using dimension values
If you have already used Cognos filters to create Dimensions in Metric Insights, you can quickly choose which Dimension Values you want to use for pre-filtering:
- IBM Cognos Filter Name: Define the name of the filter from Cognos.
- Filter Values: choose 'Map to Dimension Values'.
- Dimension: select a corresponding Dimension from the drop-down list and all its Values are going to be loaded to the Values list automatically.
- Save your entry.
NOTE: Dimensions used here must have Values that exactly match the Filter Values in Cognos (if the Values do not match, the Filter will not work)
3. How do I add filters to a results set from IMB Cognos?
- Click the Pencil icon in the filter row to add it.
- When the filter is added, you can use it for "All Values", "Only Selected Values" or ignore it.
4. Deleting Filters
To delete some of the added filters: (1) click the Filter icon in the Report field and (2) choose the unnecessary filters. Click the Trash bin icon in the corresponding row.