COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: ghostraider on 15 Jul 2008 07:14:23 PM

Title: Filter on a Master Detail Report
Post by: ghostraider on 15 Jul 2008 07:14:23 PM
Hi All,

I have a report where i am using Master Detail Relationships. I have two queries, Master and Detail. Master has 'CompID', 'CompName' and 'Receipt Date' as its items. Detail has 'CompID' and 'Frequency Code' as its items. A master detail relationship has been created using CompID and the items are used in two list reports, one within the other. Now i have to apply a filter as below.

If (frequency code in b, c, d, e and Receipt Date is six months (or more) prior to the beginning of this month) OR
(Frequency code in a, f, g, h and Receipt Date is two years (or more) prior to the beginning of this month).

Could someone please let me know how to go about this. I am aware that both the queries can be joined to form a third query and be used in a list but i would like to know how to apply this filter in Master Detail.

Thank you for your time.

Title: Re: Filter on a Master Detail Report
Post by: m23 on 16 Jul 2008 03:04:41 AM
I don't think you aren't going to be able to apply that filter unless you get all your items into one query. Once you have only one query you can still use it in a master detail relationship same as you had before but instead of a different query for each, both lists will run off the new combined query.
Title: Re: Filter on a Master Detail Report
Post by: Robl on 16 Jul 2008 04:56:56 AM
I agree, you can’t do that in one query.
You could create two unions of the tables, one for your master query and another for your detail with the master not having the items in it.
I’m not sure how efficient this would be though, or what advantage it would give over a single query with all the data in.