Hi all,
I want to use a filtered view for a customized object. This object is 'installation orders' and I want to filter the view by 'promised installation date' is 'previous business day'. So filter on yesterday, but when yesterday falls in the weekend --> show the installation order of the last weekday (aka Friday).
I added a custom field (named 'PreviousWeekday') (under the field 'Installation Order'), with the following formula (type: date):
CASE(
MOD( PromisedInstallationDate__c - DATE( 1900, 1, 7 ), 7 ),
7, PromisedInstallationDate__c -2,
1, PromisedInstallationDate__c -3,
PromisedInstallationDate__c -1
)
Where the outcome should be the previous business day.
However, when I want to use this as a filter in a view, I get three picklists where the first is:
'Field' then 'Operator' and third 'Value'.
Field should be 'PreviousWeekday' but I do not know what to pick for the other two. An example of what can be picked is ('equal to' and 'YESTERDAY').
- 1. Does anyone know if my formula is right? If not, what it should be?
- 2. What should I fill out from the picklist 'Operator' and in the box 'Value'?
- 3. Recommendations for another way to get a view that sorts by the previous business day?
Thanks in advance!
I made it work! I used the following formula:
CASE(
MOD( PromisedInstallationDate__c - DATE( 1900, 1, 7 ), 7 ),
7, PromisedInstallationDate__c -2,
1, PromisedInstallationDate__c -3,
PromisedInstallationDate__c -1
)
With the list view values:
Previous Weekday equals 'Last 2 days'
Previous Weekday does not equal 'Last 1 days'