1

I have a formula field on an object that displays an image if certain criteria are met:

IF(Anonymous__c ,
    IMAGE("/servlet/servlet.FileDownload?file=015A0000001dCp6",
        "Anonymous - Do Not Contact or Solicit"),
    IF(Another_Condition__c,
        IMAGE("/servlet/servlet.FileDownload?file=015A0000001dCp6",
            "Etc. - Imagine a cascade of conditions"), null))

I'm trying to filter a report to exclude any record that displays an image in this field. I've tried the usual:

Image Filter not equal to <blank>

But it doesn't work. Is there a way to do this?

  • 2
    By the way, you should not try to filter on formulas anyways, at least not in the presence of at least one other filter, because of the effect of causing a full-table scan-- your report will take far longer to run than if you just filtered on Anonymous__c or Another_Condition__c directly, especially if that field is indexed. – sfdcfox Jan 14 '14 at 21:59
  • @sfdcfox absolutely, although at our data volumes (for this object) the difference is negligible. What's nice about formulas is it lets us abstract the logic into the data model, rather than needing to maintain similar logic in many places (several reports, list views, etc.) – Benj Jan 14 '14 at 22:02
3

Consider splitting the logic out into a separate formula for the text and image versions:

Filter_Field__c = IF(Anonymous__c, "Is Anonymous",
                 IF(Another_Condition__c, "Etc. - Imagine a cascade", null))

Image_Field__c = CASE(Filter_Field__c,
                "Is Anonymous", IMAGE(forAnonymous),
                "Etc. - Imagine a cascase", IMAGE(forEtc),
                null)

And then filter your report based on Filter_Field__c.

0

Maybe you could consider filtering by non-formula fields (Anonymous__c, Another_Condition__c) used in the original formula field?

In such approach your filter would look like:

Filter Logic: 1 OR (2 AND 3)
1. Anonymous__c equals true 
2. Anonymous__c equals false
3. Another_Condition__c equals true


This should result with all records (which would by original criteria have their formula field populated with image url) being pulled in by the report.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.