COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: RL_Boston on 30 Dec 2010 02:52:47 PM

Title: How to Filter within specified column?
Post by: RL_Boston on 30 Dec 2010 02:52:47 PM
Hi everyone, sorry if this question has been asked but I couldn't find a prior topic.

Within a Crosstab, I just want to apply a filter to a specific column and not have it affect all the other columns.
Is this possible? Is so, how would I go about doing it?

Thanks
Title: Re: How to Filter within specified column?
Post by: MFGF on 30 Dec 2010 04:08:52 PM
Hi,

The relevant answer really depends on whether your report is based on a relational or dimensional package.  If you can advise us which you have, we should be able to suggest some approaches.

Regards,

MF.
Title: Re: How to Filter within specified column?
Post by: RL_Boston on 07 Jan 2011 05:02:14 PM
I have a Relational Package. All the columns are measures of case types, then the rows would be the individual weeks of the year.
So I want to have the first few columns filter on criteria A, then the last couple of columns to filter on criteria B. However with the weeks and totals for each annual quarter to line up. Does this help clarify my scenario?

Title: Re: How to Filter within specified column?
Post by: PRIT AMRIT on 09 Jan 2011 08:30:05 PM
Hi,

Does it make any sense, if you can write a CASE or If/else statement for those columns you want to filter individually?

Say, Column 1-- Case Criteria A then the Value End
       Column 2-- Case Criteria B then the Value End

Let me know if this is what you are looking at?

Thanks
P
Title: Re: How to Filter within specified column?
Post by: RL_Boston on 14 Jan 2011 04:01:12 PM
I can't seem to figure out how to write this case statement. Not sure what I would be using for the 'case' and how to add the filter within the 'Then'.

Here are my variables -

Column: Total$
Row:  Week#
Filter: Account Description Not like '%Europe%'

Basically, I want to have the total$ for all accounts that are not in Europe.

And this filter should not affect my other columns?
Title: Re: How to Filter within specified column?
Post by: cognostechie on 15 Jan 2011 07:38:20 PM
If ([Account Description] like '%Europe%')
THEN (0)
ELSE ([Total$])

CASE
WHEN ([Account Description] like '%Europe%') THEN (0)
ELSE ([Total$])
END
Title: Re: How to Filter within specified column?
Post by: RL_Boston on 18 Jan 2011 01:55:23 PM
Awesome - I switched the Then and Else around to get what I needed.

If ([Account Description] like '%Europe%')
THEN ([Total$])
ELSE (0)

Thanks!
Title: Re: How to Filter within specified column?
Post by: cognostechie on 18 Jan 2011 04:22:05 PM
That will be opposite of what you wanted (mentioned earlier). Just so you know..