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 " "
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
Thank you for the reply.
I did exactly like you mentioned here. Also, tried couple things. But it is giving me Parsing Error.
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?