jlisburn Posted September 5, 2012 Posted September 5, 2012 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
comment Posted September 5, 2012 Posted September 5, 2012 How about = Case ( IsEmpty ( CardWallCert ) ; "NO card/cert, " ; CardWallCert = "Wall Certificate" ; "NO card, " ; CardWallCert = "Wallet Card" ; "NO cert, " )
jlisburn Posted September 11, 2012 Author Posted September 11, 2012 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?}
comment Posted September 11, 2012 Posted September 11, 2012 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.
jlisburn Posted September 12, 2012 Author Posted September 12, 2012 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
comment Posted September 13, 2012 Posted September 13, 2012 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" )
jlisburn Posted September 13, 2012 Author Posted September 13, 2012 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.
Recommended Posts
This topic is 4454 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now