COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: bloggerman on 23 Jun 2012 03:08:59 PM

Title: Query Reference a query
Post by: bloggerman on 23 Jun 2012 03:08:59 PM
I have 2 queries that are exactly the same in structure. They differ only in filter. One has a filter on one value of a column and the second query has a filter on another value of the same column, This would mean that 2 separate queries would be executed

I was thikning of having one main query and the use 2 query references. I will put the filters on the reference query. I am hoping that this would be better for performance. is that so?
Title: Re: Query Reference a query
Post by: blom0344 on 25 Jun 2012 06:13:49 AM
If both filters work through an index scan on the database, you will possibly lose selectivity by using your proposed solution. In these cases, why not test both solutions and determine which one is the favourable one..?
Title: Re: Query Reference a query
Post by: bi4u2 on 25 Jun 2012 08:17:01 AM
It sounds like you can have one query that uses an 'in' filter rather than an 'equal'? Data item in ('value1','value2') instead on Data Item = 'Value1'.
Title: Re: Query Reference a query
Post by: blom0344 on 25 Jun 2012 02:01:49 PM
Quote from: bi4u2 on 25 Jun 2012 08:17:01 AM
It sounds like you can have one query that uses an 'in' filter rather than an 'equal'? Data item in ('value1','value2') instead on Data Item = 'Value1'.

True ,if you want all data in 1 datacontainer. If each dataset should be used for a specific container, then this will not work