Cognos Analytics 11 - Age groups

345 Views Asked by At

I have a data element expression I want to use as a category for a crosstable.

This gives me the errors "QE-DEF-0459 CCLException" and "QE-DEF-0261 QFWP", although I have followed the syntax properly. Any ideas what is causing this? It seems to be related to the [BIRTHDATE] column inside the when-clauses.

The error message goes like this: qe-def-0260 parsing error before or near position: 40 in: "case when (_years_between(current_date,"

The source database is Oracle.

1

There are 1 best solutions below

4
On

Usually there are messages which are appended after the error number. The message should be helpful in solving your problem, so reading it would be helpful for you and including the text, rather than just quoting an error number when you ask for assistance could be helpful to others.

I'm not familiar with any case function in Cognos where the query item is required after the case.

Also Case requires an end operator.

Re-write your expression to be something like this, where I've removed birthdate and added the end.

case 
when (_years_between(current_date, [BIRTHDATE])>=0 and _years_between(current_date, [BIRTHDATE])<=49) then '0-49'
when (_years_between(current_date, [BIRTHDATE])>=50 and _years_between(current_date, [BIRTHDATE])<=100) then '50-100' 
else 'null'
end

enter image description here