+ Start a Discussion
CRMsimpleCRMsimple 

Image Formula Field for colored flags - Need Help!

I got this to work fine

IMAGE (IF( Days_Open__c < 4,"/img/samples/flag_green.gif", "/img/samples/flag_red.gif"),
"Status Flag")


But now I want to add more statements like Days_Open_c > 4, but < 7 yellow, or >= 7 red

Can anyone help me with this?
Best Answer chosen by Admin (Salesforce Developers) 
AdminisaurusRexAdminisaurusRex
Looks like youll have to use some nested IFs
 
IMAGE (
             IF( Days_Open__c < 4,"/img/samples/flag_green.gif",
               IF(AND(Days_Open__c >4,Days_Open__c <7),"/img/samples/flag_yellow.gif",
"/img/samples/flag_red.gif"  )),
"Status Flag"  )


Something like that.  I don't think you can use Case here, even though you are relying on the same field.  Looking forward to some corrections from others on this board.

All Answers

AdminisaurusRexAdminisaurusRex
Looks like youll have to use some nested IFs
 
IMAGE (
             IF( Days_Open__c < 4,"/img/samples/flag_green.gif",
               IF(AND(Days_Open__c >4,Days_Open__c <7),"/img/samples/flag_yellow.gif",
"/img/samples/flag_red.gif"  )),
"Status Flag"  )


Something like that.  I don't think you can use Case here, even though you are relying on the same field.  Looking forward to some corrections from others on this board.
This was selected as the best answer
CRMsimpleCRMsimple
This worked perfectly. Thanks!
Johann FürmannJohann Fürmann

You can avoid nested IFs by using CASE.

For more information see the examples:

http://login.salesforce.com/help/doc/en/useful_advanced_formulas.htm#CaseManagementTitle