AnsweredAssumed Answered

Simpler calculation possible? (Case with multiple conditions)

Question asked by BobSchwenkler on Dec 28, 2010
Latest reply on Dec 28, 2010 by BobSchwenkler

Title

Simpler calculation possible? (Case with multiple conditions)

Post

Edit:Solution I used to solve this issue is down at (what is currently) the bottom of this thread.

Hi All,

I have a calculation for a category ID field set to automatically enter either two values, or one or the other of the two.

Simplified, what I'm currently doing is as follows:

case(x=true and y=true;result 1;

x=true and y=false;result 2;

x=false and y=true;result3;

default result)

The calculation is manageable as is but if I want to add more variables it could get unwieldy pretty fast. Is there a simpler way to do this? Below is the actual calculation.

Case(

(PatternCount ( Self;"38")=0 or IsEmpty(contactCategoryID))and (not IsEmpty(Contacts_Assign Contact Category If Distro Vendor_INVENTORY::vendorID) and PatternCount(Self;"27")=0);"38¶27¶"&contactCategoryID;

(PatternCount ( Self;"38")=0 or IsEmpty(contactCategoryID))and (not IsEmpty(Contacts_Assign Contact Category If Distro Vendor_INVENTORY::vendorID) and PatternCount(Self;"27") > 0);"38¶"&contactCategoryID;

(PatternCount ( Self;"38") > 0 or IsEmpty(contactCategoryID))and (not IsEmpty(Contacts_Assign Contact Category If Distro Vendor_INVENTORY::vendorID) and PatternCount(Self;"27")=0);"27¶"&contactCategoryID;

Self)

Outcomes