COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: aww91 on 12 Dec 2020 05:25:01 PM

Title: List Filter on single column
Post by: aww91 on 12 Dec 2020 05:25:01 PM
Hi,
I am new to Cognos 11 Reporting so please excuse the my lack of understanding. I want to filter a particular column in a list without impacting other lists that uses the same query. My background is BusinessObjects which has Query Filters and View Filters. Thanks in advance
Title: Re: List Filter on single column
Post by: oscarca on 14 Dec 2020 02:26:19 AM
I am assuming this is relational data, then you could use a case/if-statement to accomplish this:

Create a Data item "USA" and write the following expression:

case
       when [Country] = 'USA'
       then  [Country]
       else null
end

If you want the Data item to filter based on a prompt selection then you could use a prompt macro:

Data item (Country Selection)
#prompt('pCountry', 'string','[Country column]')#

//Oscar
Title: Re: List Filter on single column
Post by: aww91 on 14 Dec 2020 06:19:20 AM
Interesting. So would the prompt affect the entire report or just the specific page?
Title: Re: List Filter on single column
Post by: oscarca on 14 Dec 2020 07:47:50 AM
It will only affect the list/crosstab where you place the data item i.e not the whole report/page/query. It is like a dynamic data item filter.