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

Cognos Data Item

Started by dri, 18 Mar 2016 10:11:35 PM

Previous topic - Next topic

dri

I need to create this data item. What would be the best way to write it in Cognos as a data item?

if {Status}="C" OR {Status}="CD" OR {Status}="D" OR {Status}="E" OR {Status}="ED" OR {Status}="EF" OR {Status}="A" OR {Status}="00" then "ADA"
else
if {Status}="CC" OR {Status}="AC" OR {Status}="DA" OR {Status}="EA" then "HCC"
else " "

bus_pass_man

You might want to try to simplify that expression.   Try a case construct.  Also think about using the IN operator.  I think your expression can be reformulated into something like this.   

CASE
WHEN ({Status} in ('C','CD'   etc. ) THEN ('ADA')
WHEN(status in ('CC', 'AC' etc) THEN ('HCC')
ELSE ""
END

dri

Thank you for the reply.

I did exactly like you mentioned here. Also, tried couple things. But it is giving me Parsing Error.

bus_pass_man

QuoteI did exactly like you mentioned here.

Usually there's more to error messages.  That might be a good place to start your troubleshooting.

Are you using single quotes?   Any quotes,  commas or brackets missing?  Is the error complaining about the use commas in the expression when your locale expects something else?


Quotetried couple things.
Such as?  What did you observe?