Activity Forums Salesforce® Discussions A formula field dependent on a picklist value in Salesforce

  • A formula field dependent on a picklist value in Salesforce

    Posted by Radhakrishna on July 28, 2017 at 7:48 am

    I am in the process of setting up a new grading system on my Task object. There are a bunch of fields and depending on the Task Type (a picklist), each field would need to hold a different, predefined score.

    The second component to this grading system would need to factor in an additional bunch of fields which would also hold a different, predefined score. (These fields however would need to deduct points from the score obtained in the first section).

    Ultimately, the overall grading 'score' would need to calculate both the points gained and those deducted.

    Is this possible within the Salesforce platform or would I require the Process Builder?

    Many thanks!

    shariq replied 6 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • shariq

    Member
    September 19, 2017 at 8:35 am

    Hi Radhakrishna,

    This is possible within salesforce platform,

    for example:-

    I have created some fields which are, 2 picklist(gradeAdded and gradeDeducted), 5 formula fields(score1Add, score2Add, score1Deduct, score2Deduct and gradeTotal) .

    picklist value for gradeAdded:-

    1.value1

    2.value2

    picklist value for gradeDeducted:-

    1.value1-

    2.value2-

    formula expressions for given 5 formula fields:-

    1.score1Add - IF(TEXT(gradeAdded__c)=='value1' , 20, IF(TEXT(gradeAdded__c)=='value2',10,null))

    2.score2Add - IF(TEXT(gradeAdded__c)=='value2' , 20, IF(TEXT(gradeAdded__c)=='value1',10,null))

    3.score1Deduct - IF(TEXT(gradeDeducted__c)=='value1-' , 10, IF(TEXT(gradeDeducted__c)=='value2-',5,null))

    4.score2Deduct - IF(TEXT(gradeDeducted__c)=='value2-' , 10, IF(TEXT(gradeDeducted__c)=='value1-',5,null))

    5.gradeTotal - ( score1Add__c + score2Add__c )-( score1Deduct__c + score2Deduct__c )

    If you have any queries please ask.

    Hope this helps.

    • This reply was modified 6 years, 7 months ago by  shariq.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos