function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
petec@i2isyspetec@i2isys 

Reference formula field in formula

Hello, I'm trying to get a text formula field working that would kick back the value of another formula field.


IF(
AND(ISPICKVAL( Cerner_Tier__c,"A"), TEXT(End_Market__c),
IF(
AND(ISPICKVAL( Cerner_Tier__c,"B"), TEXT(End_Market__c),
IF(
AND(ISPICKVAL( Cerner_Tier__c,"C"), TEXT(End_Market__c),
IF(
AND(ISPICKVAL( Cerner_Tier__c,"D"), TEXT(End_Market__c),
IF(
AND(ISPICKVAL( Cerner_Tier__c,"E"), TEXT(End_Market__c), null))))))))))

Basically, if the Tier is filled in with A-E, then I would like what is in the End Market field to display. The End Market field is a text formula that looks at the classification picklist fied and displays some values.  I used the CASE function for that and it works fine.  However, this formula that references that formula field errors out with this:
Error: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Text
Best Answer chosen by petec@i2isys
Anthony McDougaldAnthony McDougald
Hello Petec,
Hope that your day is off to an amazing start. You're getting this error because you're referencing a text field within the text function. We've corrected your code and please report back if anything. May God bless you abundantly and a successful new year.
IF(
ISPICKVAL( Cerner_Tier__c,"A"), End_Market__c,
  IF(
ISPICKVAL( Cerner_Tier__c,"B"), End_Market__c,
    IF(
ISPICKVAL( Cerner_Tier__c,"C"), End_Market__c,
      IF(
ISPICKVAL( Cerner_Tier__c,"D"), End_Market__c,
        IF(
ISPICKVAL( Cerner_Tier__c,"E"), End_Market__c, 
             null)
            )
         )
      )
   )


Best Regards,
Anthony McDougald

All Answers

Anthony McDougaldAnthony McDougald
Hello Petec,
Hope that your day is off to an amazing start. You're getting this error because you're referencing a text field within the text function. We've corrected your code and please report back if anything. May God bless you abundantly and a successful new year.
IF(
ISPICKVAL( Cerner_Tier__c,"A"), End_Market__c,
  IF(
ISPICKVAL( Cerner_Tier__c,"B"), End_Market__c,
    IF(
ISPICKVAL( Cerner_Tier__c,"C"), End_Market__c,
      IF(
ISPICKVAL( Cerner_Tier__c,"D"), End_Market__c,
        IF(
ISPICKVAL( Cerner_Tier__c,"E"), End_Market__c, 
             null)
            )
         )
      )
   )


Best Regards,
Anthony McDougald
This was selected as the best answer
Abdul KhatriAbdul Khatri
Hi Petec

You can simplified like this
 
IF( CONTAINS ( "ABCDE", Text ( Cerner_Tier__c) ), End_Market__c, null)


Let me know if helped
petec@i2isyspetec@i2isys
Thank you Anthony, that worked! God Bless you in the New Year too!