If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

why is the expression not working

Started by nrhodes00, 31 Aug 2011 02:21:40 PM

Previous topic - Next topic

nrhodes00

Not sure what i'm missing

(if ([Coverage Option 2] is missing))
then([Coverage Option 3]))

(if ([Coverage Option 3] is missing)
then ([Coverage Option 2]))

(if ([Coverage Option 2] is missing and [Coverage Option 3]is missing)
then ([Coverage Option Code]) )

else ('xxxx')

sir_jeroen

what about:
case
when ( [c2] is missing) then ([c3])
when ( [c3] is missing) then ([c2])
when (c2 is missing and c3 is missing) then ([coc])
else ('xxxx')
end


MFGF

Quote from: nrhodes00 on 31 Aug 2011 02:21:40 PM
Not sure what i'm missing

(if ([Coverage Option 2] is missing))
then([Coverage Option 3]))

(if ([Coverage Option 3] is missing)
then ([Coverage Option 2]))

(if ([Coverage Option 2] is missing and [Coverage Option 3]is missing)
then ([Coverage Option Code]) )

else ('xxxx')

As RA says above, but you also need to be aware that expressions get evaluated in the order in which you declare them, and once a True result is found, no further processing occurs. This would mean that you could have a situation where both Coverage Option 3 and Coverage Option 2 are missing, but the expression returns Coverage Option 3 (a null) because the first expression would evaluate as True.

You should probably rearrange the order to check for both Coverage Option 2 and Coverage Option 3 missing in the first expression:

case
when ( [Coverage Option 2] is missing and [Coverage Option 3] is missing) then ([Coverage Option Code])
when ( [Coverage Option 2] is missing) then ([Coverage Option 3])
when ( [Coverage Option 3] is missing) then ([Coverage Option 2])
else ('xxxx')
end

or alternatively:

if ([Coverage Option 2] is missing and [Coverage Option 3] is missing) then ([Coverage Option Code]) else if ([Coverage Option 2] is missing) then ([Coverage Option 3]) else if ([Coverage Option 3] is missing) then ([Coverage Option 2]) else ('xxxx')

Regards,

MF.




Meep!