Jonathan
Jonathan

Reputation: 55

Cognos Analytics: QE-DEF-0459 on a CASE WHEN expression

I am trying to create a new data item based on certain conditions. I did run across a couple of threads regarding this very issue, but I either don't know what syntax I need or I can't find where my syntax error is located. I am receiving a parsing error: QE-DEF-0459, QE-DEF-0260, and QE-DEF-0261 for the below code.

CASE
    WHEN [Shipping].[Wave PARM].[MISC_STAT_CODE_2] =2 AND [ASRS_Lines] IS NOT NULL
        THEN 'Sent'
    WHEN [Shipping].[Wave PARM].[MISC_STAT_CODE_2] !=2 AND [ASRS_Lines] IS NOT NULL
        THEN 'Not Sent'
    ELSE NULL
END

I can't seem to figure out how to correct this error and any help would be greatly appreciated.

I have also tried...

IF  [Shipping].[Wave PARM].[MISC_STAT_CODE_2] = 2 AND [ASRS_Lines] IS NOT NULL
        THEN 'Sent'
    ELSE IF [Shipping].[Wave PARM].[MISC_STAT_CODE_2] != 2 AND [ASRS_Lines] IS NOT NULL
        THEN 'Not Sent'
    ELSE NULL
END

Thank you in advance.

Upvotes: 0

Views: 2253

Answers (1)

dougp
dougp

Reputation: 3089

There is only one item that Cognos may take issue with there. Try <> instead of !=.

If that doesn't fix the problem, try deleting that data item and validating the report. If it still fails, that data item is not where the problem is.

Upvotes: 1

Related Questions