From my test, your original SQL code and FM code produce the same results. See below
create table bxg_test1 (cd_regrp_compt varchar (4), cd_prodt varchar(5))
insert into bxg_test1 (cd_regrp_compt, cd_prodt) values
('CF26', 'ZA036'),
('CF26', 'XX036'),
('XX26', 'ZA036'),
('XX26', 'XX036')
/*** RESULTS #1
cd_regrp_compt cd_prodt
CF26 XX036
XX26 ZA036
XX26 XX036
***/
select * from bxg_test1 where
NOT (
[CD_REGRP_COMPT] in ('CF26', 'CF27', 'CF28', 'CF29')
and [CD_PRODT] = 'ZA036'
)
/*** RESULTS #2
cd_regrp_compt cd_prodt
CF26 XX036
XX26 ZA036
XX26 XX036
***/
select * from bxg_test1 where
NOT (CD_REGRP_COMPT IN (
'CF26',
'CF27',
'CF28',
'CF29' ) ) OR
NOT (CD_PRODT = 'ZA036' )
------------------------------
brenda grossnickle
BI Programmer Analyst
FIS
------------------------------
Original Message:
Sent: Fri August 29, 2025 01:18 PM
From: Guillaume Lafrance
Subject: Filter in my Cognos Framework Manager that does not give the correct SQL result
Hello,
I have a filter in one of my query subject as follows :
NOT (
[Vue physique].[D_COMPTE_SF_COMMUN_H].[CD_REGRP_COMPT] in ('CF26'; 'CF27'; 'CF28'; 'CF29')
and [Vue physique].[D_HIERC_PRODT_SF_CALC_C].[CD_PRODT] = 'ZA036'
)
The problem is that Cognos interprets this filter incorrectly in SQL :
WHERE NOT ( D_COMPTE_SF_COMMUN_H.CD_REGRP_COMPT IN ( 'CF26', 'CF27', 'CF28', 'CF29' ) ) OR NOT ( D_HIERC_PRODT_SF_CALC_C.CD_PRODT = 'ZA036' ) |
I want both conditions to be true to exclude this data in my table. Cognos don't to that at all. I think maybe it's because my two filters are in different dimensions. But both are link to the fact table.
I tried also :
NOT (
[Vue physique].[D_COMPTE_SF_COMMUN_H].[CD_REGRP_COMPT] in ('CF26'; 'CF27'; 'CF28'; 'CF29')
or [Vue physique].[D_HIERC_PRODT_SF_CALC_C].[CD_PRODT] = 'ZA036'
)
[Vue physique].[D_COMPTE_SF_COMMUN_H].[CD_REGRP_COMPT] not in ('CF26'; 'CF27'; 'CF28'; 'CF29')
and [Vue physique].[D_HIERC_PRODT_SF_CALC_C].[CD_PRODT] <> 'ZA036'
Cognos still interprets it wrong.
What is the problem?
Thanks.
------------------------------
Guillaume Lafrance
------------------------------