COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: BigOCombe on 06 May 2013 11:37:34 AM

Title: Filtering on a specific list on a join query
Post by: BigOCombe on 06 May 2013 11:37:34 AM
Hello Group,

Here is what I am looking to do. I have a sales query and a inventory query and I am joining on part id. I have a specific list of 100 part id's that I want to use. I don't want to have to maintain the list in both the sales query and the inventory query, is there a way to add the list of 100 part id's to the final query without having to key them in one by one?

Thanks!
Title: Re: Filtering on a specific list on a join query
Post by: the_xxx on 06 May 2013 12:10:05 PM
You can use a detailed filter in the final query using in condition (Ex: Part_id in ('1','2','3','4'....). I hope this helps.
Title: Re: Filtering on a specific list on a join query
Post by: BigOCombe on 06 May 2013 12:32:58 PM
the_xxx

This still requires a manual entry of each Part_id correct? If not, maybe I am not sure how the in condition works.
If I am just using a simple sales query I can copy a list of Part_id's from Excel and past it into the filter without having to key in each individual sku. I am trying to replicate this same type of process with a join query and on the final query. I hope this makes sense. What I am trying to accomplish is to not have to keep the list updated in both a inventory query and a sales query.

Thanks!
Title: Re: Filtering on a specific list on a join query
Post by: Michael75 on 08 May 2013 05:05:46 AM
BigOCombe, try this:

1. Create a new query PartNosToInclude which has one column, Part_Id, and populate this from your Excel (or whatever)

2. Add a new filter to your sales query:     [Sales].[Part_Id] in ([PartNosToInclude].[Part_Id])

3. Add a similar filter to your inventory query:     [Inventory].[Part_Id] in ([PartNosToInclude].[Part_Id])

If I've understood your requirement correctly, this should achieve the desired effect.
Title: Re: Filtering on a specific list on a join query
Post by: BigOCombe on 08 May 2013 08:46:49 AM
Thanks Michael75, that worked perfect.