Ask Search:
Tizian KirchmannTizian Kirchmann 

Advanced formulas

Hi,

Im stuck at the trailhead module "advanced formulas" (unit "use text formulas").

The goal is this:

"The image formula should reference the helper formula, and return an image based on the number returned by the helper formula. The image formula should be of type Text. Note: All of these images are already available in your Developer Edition.
1 = /img/samples/stars_100.gif with alternate text '1 star'
2 = /img/samples/stars_200.gif with alternate text '2 stars'
3 = /img/samples/stars_300.gif with alternate text '3 stars'
4 = /img/samples/stars_400.gif with alternate text '4 stars'
5 = /img/samples/stars_500.gif with alternate text '5 stars'
If none of the fields are filled out, the default should be /img/samples/stars_000.gif with alternate text '0 stars'.
The 'Lead Quality' formula must be added to the Lead Layout page layout."

My formula looks like this at the moment:
CASE(Lead_Quality_Helper__c, 
     1, IMAGE("/img/samples/stars_100.gif", "1 star"),
     2, IMAGE("/img/samples/stars_200.gif", "2 stars"),
     3, IMAGE("/img/samples/stars_300.gif", "3 stars"),
     4, IMAGE("/img/samples/stars_400.gif", "4 stars"),
     5, IMAGE("/img/samples/stars_500.gif", "5 stars"),
        IMAGE("/img/samples/stars_000.gif", "0 stars"))

It has got no syntax errors, but still seems to be wrong somehow.
I get the following error message:

"The Lead object does not display the formula fields correctly. Tip: check the requirements again and make sure you have the correctly forumlas and their values."

Any ideas?
Best Answer chosen by Tizian Kirchmann
Amit SinghAmit Singh
Hi,

Try below formula For Lead Quality Helper
IF(ISBLANK(Company) , 0, 1)  + IF(  ISBLANK(Email) , 0, 1) + IF(   ISPICKVAL(Industry, ""), 0, 1) + IF(  ISBLANK(  Phone ) , 0, 1) + IF(  ISBLANK(  Title ) , 0, 1)

AND Below for Lead Quality
CASE( Lead_Quality_Helper__c , 1,  IMAGE("/img/samples/stars_100.gif", "1 Star") , 2, IMAGE("/img/samples/stars_200.gif", "2 Stars"),3,IMAGE("/img/samples/stars_300.gif", "3 Stars"),4,IMAGE("/img/samples/stars_400.gif", "4 Stars"),5,IMAGE("/img/samples/stars_500.gif", "5 Stars"),IMAGE("/img/samples/stars_600.gif", IMAGE("/img/samples/stars_000.gif", "1 Star")))

 

All Answers

Amit SinghAmit Singh
Hi,

Try below formula For Lead Quality Helper
IF(ISBLANK(Company) , 0, 1)  + IF(  ISBLANK(Email) , 0, 1) + IF(   ISPICKVAL(Industry, ""), 0, 1) + IF(  ISBLANK(  Phone ) , 0, 1) + IF(  ISBLANK(  Title ) , 0, 1)

AND Below for Lead Quality
CASE( Lead_Quality_Helper__c , 1,  IMAGE("/img/samples/stars_100.gif", "1 Star") , 2, IMAGE("/img/samples/stars_200.gif", "2 Stars"),3,IMAGE("/img/samples/stars_300.gif", "3 Stars"),4,IMAGE("/img/samples/stars_400.gif", "4 Stars"),5,IMAGE("/img/samples/stars_500.gif", "5 Stars"),IMAGE("/img/samples/stars_600.gif", IMAGE("/img/samples/stars_000.gif", "1 Star")))

 
This was selected as the best answer
Tizian KirchmannTizian Kirchmann
Thanks Amit and thanks Krutarth.

My formular for lead quality was correct. I just had the wrong formula for lead quality helper.
After replacing it with Amits formula above it worked. :)
Amit SinghAmit Singh
Cheers :) This is what we are here :)