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
janeisaacjaneisaac 

getting the Expected Boolean error message - what did I do wrong?

If all 4 of these 4 Currency fields (populated from a nightly batch interface) have something in them greater than Zero, I would like the result to be 4. But the Syntax error says (highlighting the 4) it was expecting Booleam and received Number.

 

AND( X01_to_30__c >0, X31_to_60__c >0, X61_to_90__c >0, X91_Plus__c >0,4,0)

 

 

Can someone point out to me the error of my ways here?

 

Thanks,

Jane

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Okay here's a few you can try:

IF(
AND(
X01_to_30__c  > 0, 
X31_to_60__c > 0, 
X61_to_90__c > 0, 
X91_Plus__c > 0),
4,0)

 or you could do this one, which will show 4,3,2,1, 0 accordingly

 

IF(X01_to_30__c  > 0, 1,0) + 
IF(X31_to_60__c  > 0, 1,0) +
IF(X61_to_90__c  > 0, 1,0) +
IF(X91_Plus__c  > 0, 1,0) 

 

All Answers

Steve :-/Steve :-/

Hi Jane,

What is the datatype of the field you're populating with the Formula result?

janeisaacjaneisaac

It is a number field

Steve :-/Steve :-/

Okay here's a few you can try:

IF(
AND(
X01_to_30__c  > 0, 
X31_to_60__c > 0, 
X61_to_90__c > 0, 
X91_Plus__c > 0),
4,0)

 or you could do this one, which will show 4,3,2,1, 0 accordingly

 

IF(X01_to_30__c  > 0, 1,0) + 
IF(X31_to_60__c  > 0, 1,0) +
IF(X61_to_90__c  > 0, 1,0) +
IF(X91_Plus__c  > 0, 1,0) 

 

This was selected as the best answer
janeisaacjaneisaac

Thanks Steve - I am making progress on the formula from you know where. This helps.