COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Framework Manager => Topic started by: handpass on 30 Mar 2007 11:01:51 AM

Title: Self Join using two query subjects. Cognos 8
Post by: handpass on 30 Mar 2007 11:01:51 AM
Hi,
   I have two query subjects that have the exact same table entries in each of them. For one of the entries I have a different filter value applied for each query.

QS1
BatchId
Parameter (Filter:Parameter=Volume)

QS2
BatchId
Parameter (Filter:Parameter=Height)

I now want to join these two query subjects together so that I can get a combination of the two results.

QS1                 QS2
BatchId(1..1)_______(1..1)BatchId
Paramter                      Parameter


When I test this I don't get any results returned.
It's as if the filter value in each of the query subjects is being joined with an 'AND', and because the filter is on the same entry in both query subjects it means that it can't be two different values at the same time. I am modelling all of this in Framework manager.

Regards.
Title: Re: Self Join using two query subjects. Cognos 8
Post by: Steve on 30 Mar 2007 11:17:22 AM
Did you try creating a third query subject (with the same columns as  these two) without any filters?

Try joining both of these with the 3rd query subject. I have a similar model and it works fine.
Title: Re: Self Join using two query subjects. Cognos 8
Post by: Darek on 01 Apr 2007 03:53:34 PM
If they are joined like that, you'd be forcing an AND statement on the WHERE clause. If they are joined inside a model, then create one filter and combine both parameter filters with an OR.