Jump to content
Sign in to follow this  
jlisburn

Case Calc based on Check box

Recommended Posts

Hi,

I've got a field (CardWallCert) with a check box which is fed by a value list with entries "Wallet Card" and "Wall Certificate".

It describes which are applicable for a given course (there are a number of possible variants ) and every option is potentially possible (Either one, or the other, or both, or neither)

I'm trying to textually describe the contents of the check box (and hence the course variant) via a calculation:

eg:

Case ( IsEmpty ( CardWallCert ) ; "NO card/cert, " ; CardWallCert = "Wallet Card" and CardWallCert = "Wall Certificate" ; "" ; CardWallCert ≠ "Wallet Card" ; "NO card, " ; CardWallCert ≠ "Wall Certificate" ; "NO cert, " ; "" )

I want it to return blank if both WalletCard and WallCert are selected, but it just gives whatever relates to the last option I selected/deselected.

No doubt someone with a stronger logic brain than mine can get the desired results, perhaps even with a more concise calc. I'm trying to avoid splitting into two fields (WalletcardYN and WallCertYN)

Thanx in advance for any help

Share this post


Link to post
Share on other sites

How about =

Case (

IsEmpty ( CardWallCert ) ; "NO card/cert, " ;

CardWallCert = "Wall Certificate" ; "NO card, " ;

CardWallCert = "Wallet Card" ; "NO cert, "

)

Share this post


Link to post
Share on other sites

Thanks,

My bad, mistake in my original post, what I'm after is when:

CardWallCert = "Wallet Card" and CardWallCert = "Wall Certificate",

I want it to return "CARD or CERT"

Which is the bit I can't get:

Case (

IsEmpty ( CardWallCert ) ; "NO card/cert, " ;

CardWallCert = "Wallet Card" and CardWallCert = "Wall Certificate" ; "CARD or CERT" ;

CardWallCert = "Wall Certificate" ; "NO card, ";

CardWallCert = "Wallet Card" ; "NO cert, "

)

No joy if both are checked

even if i try:

Case (

IsEmpty ( CardWallCert ) ; "NO card/cert, " ;

CardWallCert = "Wallet Card" and "Wall Certificate" ; "CARD or CERT" ;

CardWallCert = "Wall Certificate" ; "NO card, ";

CardWallCert = "Wallet Card" ; "NO cert, "

)

Same deal - when both values are marked I get nothing returned, instead of "CARD OR CERT"

{BTW - I didn't realize you could drop the default result from a Case statement, that's cool. I case it assumes: Return NULL?}

Share this post


Link to post
Share on other sites

You may have a contradiction in your terms. I would think that "No Card" implies the existence of a certificate, and conversely "No Cert." implies the existence of a card. Both of these situations, therefore, can also be described as "CARD or CERT" (meaning "Either Card OR Cart, but not both") and you need to decide which labels you want to apply.

Note also that:

CardWallCert = "Wallet Card" and CardWallCert = "Wall Certificate"

can only be true when "Wallet Card" = "Wall Certificate", which is never.

Share this post


Link to post
Share on other sites

Thanks for your help on this, but I'm not sure I'm with you:

Some courses require a Wallet card be issued (and not a Cert- "NO cert"), some courses require a Wall Certificate be used (and not a Card- "NO card).

Some don't care and either a Wall Cert or a Wallet Card may be issued (CARD or CERT)

Some courses don't allow for anything to be issued (NO card/cert)

So I have four potential results from the state of my two value check box: one value, the other, neither or both.

Sounds like I'm way better off with two fields: CertY/N and CardY/N

Thanks again

Share this post


Link to post
Share on other sites

So I have four potential results from the state of my two value check box: one value, the other, neither or both.

That's true. I thought you wanted five possible results out of four possible states, but it turns out you merely want a non-empty default result =

Case (

IsEmpty ( CardWallCert ) ; "NO card/cert" ;

CardWallCert = "Wall Certificate" ; "NO card" ;

CardWallCert = "Wallet Card" ; "NO cert" ;

"CARD or CERT"

)

Share this post


Link to post
Share on other sites

Many thanks, that works on a nice clean example file but not in my solution (I'm also calculating other variant attributes in my result string ) so my issue must lie elsewhere.

Thanks again for your help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.