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
scottyscotty 

Formula help

I am attempting to create a formula that will allow me to utilize one field in my dashboard to annotate that a record qualifies for use.  My formula below populates a field that is labeled qualified with "Yes" or "No".  Currently, I am only getting a "Yes" on all records as the formula shows there are many variables that must be "OR" statements and "AND" statements.  Any help would be appreciated.

IF(OR(CreatedDate>= NOW() - 180,Days_since_last_Purchase__c <=365, Buy_Role_Status_Change_Date__c >= TODAY() - 180, Days_Since_Last_Attendance__c <=365,
AND(ISPICKVAL( Companay_Buy_Status__c , "Active"), TS_Left_Message__c >=TODAY()-3, Dlr_Reg_Notified__c >=TODAY()-28, TS_last_contact_date__c >=TODAY()-21),

(OR(ISPICKVAL( TS_Contact_Frequency__c , "DNC- DC Account"),ISPICKVAL(TS_Contact_Frequency__c ,"Do Not Call- Dealership Request"),ISPICKVAL( TS_Contact_Frequency__c ,"Obsolete Buyer"),ISPICKVAL( TS_Contact_Frequency__c ,"Out of Business") ))
),"Yes", "No")

scottyscotty

After more trouble shooting I have found that it looks like it works if i remove this portion 

 

(OR(ISPICKVAL( TS_Contact_Frequency__c , "DNC- DC Account"),ISPICKVAL(TS_Contact_Frequency__c ,"Do Not Call- Dealership Request"),ISPICKVAL( TS_Contact_Frequency__c ,"Obsolete Buyer"),ISPICKVAL( TS_Contact_Frequency__c ,"Out of Business") ))

Lori_Lori_

Based on where your parenthesis are located, this is what you're saying.  Is that what you really want?

IF

  (

   OR (

         CreatedDate>= NOW() - 180,

         Days_since_last_Purchase__c <=365,

         Buy_Role_Status_Change_Date__c >= TODAY() - 180,

         Days_Since_Last_Attendance__c <=365,

         AND (

              ISPICKVAL(Companay_Buy_Status__c , "Active"),

              TS_Left_Message__c >=TODAY()-3,

              Dlr_Reg_Notified__c >=TODAY()-28,

              TS_last_contact_date__c >=TODAY()-21

             ),

         (

             OR  (

                  ISPICKVAL(TS_Contact_Frequency__c , "DNC- DC Account"),

                  ISPICKVAL(TS_Contact_Frequency__c ,"Do Not Call- Dealership Request"),

                  ISPICKVAL(TS_Contact_Frequency__c ,"Obsolete Buyer"),

                  ISPICKVAL(TS_Contact_Frequency__c ,"Out of Business")

                  )

         )

      ),

   "Yes",

   "No"

  )

scottyscotty

It is getting c;lose.  The issue that I am having is that the picklist are 

OR(

ISPICKVAL(TS_Contact_Frequency__c , "DNC- DC Account"),

                  ISPICKVAL(TS_Contact_Frequency__c ,"Do Not Call- Dealership Request"),

                  ISPICKVAL(TS_Contact_Frequency__c ,"Obsolete Buyer"),

                  ISPICKVAL(TS_Contact_Frequency__c ,"Out of Business")

should have a NOT statement somewhere. Even when I run the query that I have been, I get other values from the TS_Contact_Frequency__c field.  This does not make sense to me. I am hopeful that I will be able to validate my formula once this portion is  corrected.

I appreciate your assistance.