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

Help with Detail Filter at the Query level

Started by rajua99, 14 Dec 2017 01:26:45 PM

Previous topic - Next topic

rajua99

Hello,

As of right now the i am using ([Job Type] in ('14','16','17','18','21'))  in my Detail filter.
Now the requirement is if the customer runs the report for Company Number 1 then it should bring ([Job Type] in ('14','16','17','18','21')) else for all the companies it should bring ([Job Type] in ('14','15','16','17','18','21'))..How to create this type of filter in the Detail filters...

When i am trying to use case statement at Detail filters with the below logic it is giving me error message..Syntax error near "in".

[Job Type]= CASE when [Company Number]=1 THEN ([Job Type] in ('14','16','17','18','21')) ELSE ([Job Type] in ('14','16','17','18','21')) END



BigChris

Ok - you basically want your filter to return either True or False, so you need to slightly rethink the way you format your filter statement. What you need is something like:

([Company Number] = 1 and [Job Type] in ('14', '16', '17', '18', '21')) or ([Company Number] <> 1 and [Job Type] in ('14','15','16','17','18','21'))

{don't know if you noticed the missing '15' in your original post}