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

Filtering one value based on another

Started by fml55555, 24 Jun 2014 10:23:21 AM

Previous topic - Next topic

fml55555

Hi Gurus,

I am trying to give a range of values to one data item based on value of another data item.

code
e.g.

case

when (abc = '123')) Then (cc in ('a','b','c','d'))

END

if I tried using if...but I keep getting parsing error.

QE-DEF-0459 CCLException
QE-DEF-0260 Parsing error before or near position: 42 of: "case


what am I doing wrong?

Karti

My usual debugging technique is to throw random letters inside of each part of my filter/query to pinpoint exactly where the error is occurring, due to counting the number of characters can be tedious.

I'm thinking it is missing the ELSE statement. Also not sure if you can use 'in' within the Then statement, but someone can prove me wrong on that.

Lynn

Are you trying to create a filter expression? Is this a relational package?

If yes to both, then you should avoid a case statement and stick with something that evaluates to true or false.


(
  [abc] = '123'
  and
  [cc] in ('a','b','c','d')
)


If you have more conditions, you can expand with "or" between the blocks


(
  [abc] = '123'
  and
  [cc] in ('a','b','c','d')
)
or
(
  [abc] = '456'
  and
  [cc] in ('w','x','y','z')
)



fml55555

Hi Lynn,

Thanks a lot for the detailed reply. Yes to both. Will try out the method.

Regards,
Venkat