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

Is this a Query Shortcut and when would you use one?

Started by Cape Cod Gunny, 02 Aug 2017 10:03:06 AM

Previous topic - Next topic

Cape Cod Gunny

I started using this type of a query construct where Query 2 is a subset of the more complicated Query 1. This allows me to reference an existing query and filter out only certain items of Query 1. I have a couple questions about this type of query construct.


  • What do you call type of query construct identified by Query 2
  • Is this a best practice?

Michael Riley
Marine Corps Gunnery Sergeant (Retired)

"We may never pass this way again!"

Lynn

Quote from: Cape Cod Gunny on 02 Aug 2017 10:03:06 AM
I started using this type of a query construct where Query 2 is a subset of the more complicated Query 1. This allows me to reference an existing query and filter out only certain items of Query 1. I have a couple questions about this type of query construct.


  • What do you call type of query construct identified by Query 2
  • Is this best practice?



I would call it a query reference.

It is a good technique to keep the overall code base small and to keep the important logic in one place. I would try to have Query1 return the smallest possible result set for subsequent filtering. For example, filter Query1 as much as possible to focus on what you need to satisfy other queries and keep the granularity of the results as high as you can (e.g., automatically grouped and summarized to the highest level possible).

I've seen questions posted in the past about what actually happens in the database versus locally on the Cognos server but I don't recall a definitive answer. The best I can suggest is to be aware of performance implications in case they affect you. Maybe someone who knows more about the inner workings will chime in on this also.

Cape Cod Gunny

@Lynn, thank you. I didn't know what it was called and it helps a lot knowing it is a "Reference Query".
I found this post that explains the use and re-use of queries. http://www.cognoise.com/index.php?topic=12032.0

I'm good to go!
Michael Riley
Marine Corps Gunnery Sergeant (Retired)

"We may never pass this way again!"