Filter:
It is nothing but a condition to restrict the data to be displayed on the report
There are two types of filters
- Model filter
- Report filter
Model filter:
If a filter is created at the time of designing model then it is called a model filter
Model filters are reusable
Report filter:
A filter which is created at the time of generating the report is called a report filter
Report filter is specific to that particular report only
- Again model filters are two types
- Stand alone filter
- Embedded filter
Stand alone filter:
- It is created at name space level it is available as a separate object in the model
- It can be applied for any query subject in the model
- Stand alone filters are two types
- Static filter
- Dynamic filter (or) parameterized filter (or) prompt
Static filter:
If a filter condition is created with a static value that can’t be changed at run time than it is called a static filter
Syntax to create static filter:
Query time (column) operator operand.
EX: year = 2010
EX: country in (‘India, ‘USA’)
EX: year is not in (2009, 2011)
EX: create a static filter for year 2008 at model filter
Procedure: open framework, manager with replanted project
- From project viewer pan, select the namespace (model) right click --> create--> filter--> create name year_2006--> expand product
Interested in mastering Cognos? Learn more about Cognos Tutorial in this blog post.
Testing a filter:
- Select product_fore caste query subject, right click, select edit definition
- Select filter stop drag the filter year_2006, drop on filters window
- Select test tab click on test sample
Parameterized filter:
If a filter condition is created with a parameter then it is called a parameterized filter (or) dynamic filter (or) prompts
It allows the user either select the value(s) (or) to enter the time of execution
Syntax to create parameterized filter:
Query item operator, Parameter?
EX: year =? param_year?
Country in? param_country?
Create a parameterize filter for country
- Right click on the name space
create
filter
name country (?) expand country_multilingual
drag on the country on expression definition window
ok
Procedure to create a folder under the namespace:
- Right click on the “namespace”
create folder
- Folder name
filter
next
- Select the required objects (filter) and click on finish
Embedded filter:
- If a filter is created at query subject level than it is called an embedded filter
- The scope of this filter is for the particular query subject
Procedure to create embedded filter:
Select the query subject country_mnultilingual --> rightclick select edit definition
select filter tab
click on add
filter name language_en
expression definition = ’EN’
ok
select test tab
click test sample
ok
For indepth understanding Cognos Training click on