COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS Impromptu => Topic started by: jamesh on 14 Nov 2005 11:32:40 AM

Title: Joins That Exclude
Post by: jamesh on 14 Nov 2005 11:32:40 AM
Using two hotfiles, I've created a new catalog over them.  In the catalog, I'm joining these hotfiles.  I'd like for the join to exclude Items (or key values) in the first hotfile that do not exist in the second hotfile.  I've tried a NE join, a NE with the "outside" box checked on the first, second and both files without success.

If such a join is not possible, I did see on the Filter tab, an option for a "not" operator on a dataset that's an existing .IMR report.  So then would I get the desired result if I were to create a report using the total pool of Items, then create another report with this "not in dataset..." opertor?
Title: Re: Joins That Exclude
Post by: MFGF on 14 Nov 2005 01:29:03 PM
Hi,

Unless you check the 'outer join' check boxes, a normal equi join (=) should give you what you need as long as your reports include data from both hotfiles (ie you will only end up with rows that have linking values in both tables).

Can it be that simple, or am I missing something obvious (which is quite normal with me! :-)

Regards,

MF.
Title: Re: Joins That Exclude
Post by: cognosfreelancer on 15 Nov 2005 09:03:07 AM
Create an equi join on the column that contains the key values.

Next convert it to an outer join on the second hotfile.

This way you will get rows that contain matchin key values as well as rows from the second hotfile that do not match key values from the first hotfile.

NKT
Title: Re: Joins That Exclude
Post by: jamesh on 09 Dec 2005 04:52:59 PM
Thank you for those replies.  I was a little unclear above.  The resulting data set should have in it only those values that exist in the first hotfile and do not exist in the second.  Before joining, there will be several values that are equal to each other in both hotfiles.
Title: Re: Joins That Exclude - The Solution
Post by: jamesh on 16 Jan 2006 03:29:05 PM
Finally found the right combination to include all values from the first catalog that have no match in the second.  It's a three step process: 1) Create an eqijoin on the key values of the two catalogs; 2) Make the first catalog an outer join (this will inlcude all values from that catalog); 3) Using Filter, check for "Value2 is missing" (this eliminates instances where the value appears in both catalogs.)