This topic contains 3 replies, has 0 voices, and was last updated by david.smith 7 years, 9 months ago.

  • Author
    Posts
  • #22951

    ARoberts18

    Hi there,

    I'm trying to do this:

    CASE WHEN {custrecord104.custrecord127} = '1'

    THEN

    CASE

    WHEN {custrecordf} = 'No' THEN 'Requires Attention'

    WHEN {custrecord136} = 'No' THEN 'Requires Attention'

    WHEN {custrecord136} IS NULL THEN 'Requires Attention'

    WHEN {custrecord75} = 'No' THEN 'Requires Attention'

    ELSE 'OK'

    END

    END

    CASE WHEN {custrecord104.custrecord127} = '0'

    THEN

    CASE

    WHEN {custrecord136} IS NULL THEN 'Requires Attention'

    WHEN {custrecord75} = 'No' THEN 'Requires Attention'

    ELSE 'OK'

    END

    END

    In one formula field but it isn't working. What's the correct way to do it?
    This is a cached copy. Click here to see the original post.

  • #22952

    khultquist

    Try this

    Code:
    CASE
    WHEN {custrecord104.custrecord127} = '1' THEN
    CASE
    WHEN {custrecordf} = 'No' THEN 'Requires Attention'
    WHEN {custrecord136} = 'No' THEN 'Requires Attention'
    WHEN {custrecord136} IS NULL THEN 'Requires Attention'
    WHEN {custrecord75} = 'No' THEN 'Requires Attention'
    ELSE
    CASE
    WHEN {custrecord104.custrecord127} = '0' THEN
    CASE
    WHEN {custrecord136} IS NULL THEN 'Requires Attention'
    WHEN {custrecord75} = 'No' THEN 'Requires Attention'
    ELSE 'OK'
    END
    ELSE 'OK'
    END
    END
    END

  • #22953

    ARoberts18

    Hi,

    This works!

    How do I combine these into one line:

    WHEN {custrecorda} = 'No' THEN 'Requires Attention'

    WHEN {custrecorda} IS NULL THEN 'Requires Attention'

    I can't seem to get the OR statement to work.

  • #22954

    david.smith

    WHEN ({custrecorda} = 'No' OR {custrecorda} IS NULL) THEN 'Requires Attention'

    WHEN NVL({custrecorda}, 'No') = 'No' THEN 'Requires Attention'

You must be logged in to reply to this topic.