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

Using "IN" vs using "=" as a detail filter inside a query?

Started by Cape Cod Gunny, 11 Feb 2022 10:36:18 AM

Previous topic - Next topic

Cape Cod Gunny

I'd like to understand the best way to restrict items in a query. For example Query1 returns a list of ID's based of specific detail filters. I would like Query2 to return only items where Query2.ID matches Query1.ID.

Which Query2 Detail Filter is better? And why?

Query2.ID IN ( Query1.ID )
Query2.ID = Query1.ID
Note: Using an "=" filter requires Query2's "Cross product allowed" property to be set to "Allow".
Michael Riley
Marine Corps Gunnery Sergeant (Retired)

"We may never pass this way again!"

dougp


MFGF

Quote from: Cape Cod Gunny on 11 Feb 2022 10:36:18 AM
I'd like to understand the best way to restrict items in a query. For example Query1 returns a list of ID's based of specific detail filters. I would like Query2 to return only items where Query2.ID matches Query1.ID.

Which Query2 Detail Filter is better? And why?

Query2.ID IN ( Query1.ID )
Query2.ID = Query1.ID
Note: Using an "=" filter requires Query2's "Cross product allowed" property to be set to "Allow".

Hi,

I second Doug's approach. The best option is to join the two queries, with a mandatory cardinality (probably 1..1 <--> 1..1). This will be much more efficient than trying to use cross products.

Cheers!

MF.
Meep!

Cape Cod Gunny

Michael Riley
Marine Corps Gunnery Sergeant (Retired)

"We may never pass this way again!"

MFGF

Meep!