COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jcrouch on 24 Feb 2012 10:28:55 AM

Title: Help filtering out customers who haven't bought certain products
Post by: jcrouch on 24 Feb 2012 10:28:55 AM
Hi,

I need help filtering out customers who haven't bought a certain product line. This is being done in a relational crosstab. Here is a sample of what the report looks like:

(http://home.insightbb.com/~livens/img/crossSamp.JPG)

It shows the market share of each product sold to individual customers, customers are grouped by an internal criteria. What I want to do is not show any customers who did not sell the '123' product. So in this example 'Cust 1' would not be shown because they had no sales of '123'.

Ive tried several approaches in the filters but nothing I try works. I added a Data Item that sums up the sales of '123', then filtered on that being > 0 in the Summary Filters section, setting the scope to Year and Customers.

Thanks,

Jeremy
Title: Re: Help filtering out customers who haven't bought certain products
Post by: Grim on 24 Feb 2012 01:13:58 PM
I don't do a lot of report design, but try this...
http://www-01.ibm.com/support/docview.wss?uid=swg21344613
Title: Re: Help filtering out customers who haven't bought certain products
Post by: navissar on 25 Feb 2012 03:32:27 AM
In your example, there are nulls rather than nills (Or zeros). Try filtering by "is not null" rather than ">0"
Title: Re: Help filtering out customers who haven't bought certain products
Post by: blom0344 on 25 Feb 2012 01:48:31 PM
This is not a matter concerning filtering.  The solution lies in building the crosstab against the combination of 2 - joined - queries.  The first query is the one you have now. The second query should only fetch customer(id) associated with sold/bought product 123.
The resulting set from the joined queries ( joined over customer(id) ) will then give you the required dataset.
Title: Re: Help filtering out customers who haven't bought certain products
Post by: barrysaab on 25 Feb 2012 11:44:05 PM
you have to go with outer join,rest do what Blom0344,the ultimate Cognos guru suggested.Thanks
Title: Re: Help filtering out customers who haven't bought certain products
Post by: blom0344 on 27 Feb 2012 02:05:33 AM
Why an outer join? A straight join will make sure that customers that do not meet the requirement are removed from the final set, yielding on those that are associated with sold/bought product 123
Title: Re: Help filtering out customers who haven't bought certain products
Post by: jcrouch on 27 Feb 2012 01:20:03 PM
Quote from: blom0344 on 27 Feb 2012 02:05:33 AM
Why an outer join? A straight join will make sure that customers that do not meet the requirement are removed from the final set, yielding on those that are associated with sold/bought product 123

blom0344, thank you very much! Worked perfectly.

And to barrysaab's outer join suggestion, I changed the join to and 'outer join' and it stopped filtering,sorry, excluding the companies that did not purchase 123.

+1 to blom0344 :)

Jeremy