Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to create an expression!

Status
Not open for further replies.

Jessi4

Technical User
Sep 30, 2008
3
US
I have two expressions that work, but I need to combine parts of the two. I have worked with database stuff for awhile, but am new to Cognos stuff and can't seem to get it quite right. This one works:

CASE WHEN [JOB].[EMAIL_JOBS_E].[EMAIL_TYPE] IN (1,2,4,8,10,12,15) or [LIST_ID] IN (225,226,227,228,229,230,231) THEN [JOB].
  • .[DESCRIPTION] ELSE 'N/A' END

    This one works:

    CASE WHEN [JOB].[EMAIL_JOBS_E].[EMAIL_TYPE] = 11
    THEN 'E-Mail'
    ELSE [JOB].[List Description]
    END

    I need to combine parts of the two and make it so that

    (WHEN [JOB].[EMAIL_JOBS_E].[EMAIL_TYPE] IN (1,2,4,8,10,12,15) or [LIST_ID] IN (225,226,227,228,229,230,231) THEN [JOB].
    • .[DESCRIPTION]) or (WHEN [JOB].[EMAIL_JOBS_E].[EMAIL_TYPE] = 11) THEN 'E-Mail'
      ELSE 'N/A' END

      I just don't know the wording, order, puctuation, and such to use to make it work! Can you help?
 
Try:

CASE
WHEN ([JOB].[EMAIL_JOBS_E].[EMAIL_TYPE] IN (1,2,4,8,10,12,15) or
[LIST_ID] IN (225,226,227,228,229,230,231)) THEN [JOB].
  • .[DESCRIPTION]
    WHEN ([JOB].[EMAIL_JOBS_E].[EMAIL_TYPE] = 11) THEN 'E-Mail'
    ELSE 'N/A'
    END



    SLN
 
That works! Thank you so much. I tried it like that, but I must have missed some punctuation. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top