COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: mark123 on 12 Jan 2016 01:47:16 PM

Title: Filtering data based on column values
Post by: mark123 on 12 Jan 2016 01:47:16 PM
Hi All,

I have are report in which there is a column called xyz.cd. The column contains 4 different codes. I need to build report showing data for only two of the codes.
For example if a,b,c,d are four codes in the colums i need to show corresponding data for only a and b codes.

I am using

case
when
xyz.cd like 'a'
or
xyz.cd like'b'
then
xyz.cd
end

But when i am running the report it is showing a and b in the report and it is also showing corresponding data for c and d while just hiding the codes c and d from report.

Thanks
Title: Re: Filtering data based on column values
Post by: MFGF on 12 Jan 2016 02:45:44 PM
Quote from: mark123 on 12 Jan 2016 01:47:16 PM
Hi All,

I have are report in which there is a column called xyz.cd. The column contains 4 different codes. I need to build report showing data for only two of the codes.
For example if a,b,c,d are four codes in the colums i need to show corresponding data for only a and b codes.

I am using

case
when
xyz.cd like 'a'
or
xyz.cd like'b'
then
xyz.cd
end

But when i am running the report it is showing a and b in the report and it is also showing corresponding data for c and d while just hiding the codes c and d from report.

Thanks

Hi,

I'm guessing you are using this expression in a query calculation? If so, delete the calculation, and add a detail filter to your report with the expression

[xyz.cd] in ('a', 'b')

Cheers!

MF.
Title: Re: Filtering data based on column values
Post by: mark123 on 12 Jan 2016 03:54:36 PM
Thanks

It worked