cancel
Showing results for 
Search instead for 
Did you mean: 

Formula must be a boolean

Former Member
0 Kudos

Hello world!

I am creating a report that i need to pull in prior day the formula i have is

//BeforeReadingRecords;

if DayOfWeek (CurrentDate) = 2 then CurrentDate-3 else CurrentDate -1

The message I am getting is"

"The result of selection formual must be a boolean"

Can anyone help me with this

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If you want the report to always 'Run' for prior day, then this formula needs to be written in the 'Record selection criteria' OR the 'select expert'.

To make it full proof, a 'holiday' also needs to be taken into consideration.So CurrentDate-3 should not be a holiday. In case, there is any DateTime table in the database then a hoilday column flag must be a part of it.

You need to include that condition in the formula.

-Prathamesh

Former Member
0 Kudos

My purpose is when the reports runs on Monday it will pull in Fridays data

abhilash_kumar
Active Contributor
0 Kudos

Yes, the selection formula I posted above should do just that.

-Abhilash

abhilash_kumar
Active Contributor
0 Kudos

Hi,

The formula should be:

if DayOfWeek (CurrentDate) = 2 then

     {database_date_field} = CurrentDate-3

else {database_date_field} = CurrentDate -1

-Abhilash