0

I am trying to create new formula field (Text) but I am receiving an error that says "Compiled formula is too big to execute (8,351 characters). Maximum size is 5,000 characters". What am I doing wrong? Score__c is a number field

IF((Score__c)>=13,"Critical",
    IF(AND((Score__c)>=10,(Score__c)< 13),"Major",
        IF(AND((Score__c)>=6,(Score__c)<= 9),"Medium",
            IF((Score__c)<6,"Low","None"
             )
         )
     )
)

I have tried using Text and Value but doesn't works

1
  • 1
    About the only way I can see this formula resulting in that large of a compile size is if Score__c is itself a formula field. Is that the case?
    – Derek F
    Commented Dec 3, 2021 at 21:39

1 Answer 1

2

Convert to a CASE statement so Score__c is referenced only once , assumes values are 0,1,2, ...13+.

Solution is practical as long as scores are integers within a small range. Would not work if scores could be between 1-1000 as CASE statement would get too large.

CASE(Score__c,
     0,"Low",
     1,"Low",
     ...
     6,"Medium",
     ...
     9,"Medium,
     10,"High",
     ...
     12,"High",
     "Critical"   /* 13+ */
    )
1
  • Thank you it worked
    – Admin_BA
    Commented Dec 3, 2021 at 22:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .