If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Query Subject Shortcuts - Does the query run twice against the DB?

Started by cognos_guru, 07 Jul 2009 02:17:48 PM

Previous topic - Next topic

cognos_guru

I have a query subject which returns X number of rows that I want to be displayed in a list.  Underneath that, I want another list to filter those X number of rows to exclude rows that have a certain attribute. 

I know that I cannot point both lists to the same query subject because my filter would result in filtering both lists... What are the alternatives here?  If possible, I'd like to only hit the Database with one query.

If I create a shortbut to the query subject in framework manager with the filter, will the report generate only one query against the database, or will it still be two?

Thanks

DustPanMan

You can create the one query that is hitting the database and have it used for the top list and then create a subquery (In Query Explorer, drag a query to the left of it).  Then pull in all of the Data Items you want and filter at the new query level.
Best,

D

cognos_guru

Would using a sub-query cause the application to run two queries against the database or just one?  I would need two result sets displayed seperately- one using the full query and one with the filtered data.

DustPanMan

Just one query against the database.  2 for display.  It should do precisely what you are looking for.
Best,

D

cognos_guru

Just an FYI -

I added a sub-query subject to filter off the results of the first query subject.  The results are accurate; however when I check the activity against the database, there are still two hits.  The first is the full query, the second uses a WITH to filter on the results of the first query

DustPanMan

Yikes.  Try setting the first Query to use caching and the second for "Limited Local" processing.
Best,

D