6 Replies Latest reply on Apr 24, 2019 6:03 PM by Michael Scappator

# Calculation the last business day with exclude from Saturdays and Sundays

Hello together,

I am planning to show the profit from the last business day.

My first step was to exclude Saturdays and Sundays as possible dates for the cancellation dates.

DATEPART('weekday',[Datbuch]) <> 1 AND DATEPART('weekday',[Datbuch]) <> 7

DATEPART('weekday',[Datstorno]) <> 1 AND DATEPART('weekday',[Datstorno]) <> 7

In the next step I want to include this integration into my calculation as well as starting with the last business day instead of the present day.

ZN(IF [DATEPART('weekday',[Datbuch]) <> 1 AND DATEPART('weekday',[Datbuch]) <> 7]

AND [ART]="D"

THEN [Nw1Gesnettoprofit]

END)

Thank you

Lea

• ###### 1. Re: Calculation the last business day with exclude from Saturdays and Sundays

HI,

1 of 1 people found this helpful
• ###### 2. Re: Calculation the last business day with exclude from Saturdays and Sundays

Hi ,

Please have alook at these workbooks from KB articles:

• ###### 3. Re: Calculation the last business day with exclude from Saturdays and Sundays

Thank you for the quick answer.

But my problem is not solved, unfortunately. I don't need the differences or count of the business days.

Up to now, I solve my problem by manually adapting the date from Monday and Tuesday.

For Monday: [Datbuch] = TODAY()-3

For Tuesday, Wednesday, Thursday and Friday: [Datbuch] = TODAY()-1

Is there a possibility to have this process automatically?

Thank you!

Lea

• ###### 4. Re: Calculation the last business day with exclude from Saturdays and Sundays

Hi there Lea,

The below calculated field will convert a date to the last working day:

//If sunday look 2 days back to friday

IF DATEPART('weekday',[Datbuch]) = 1 THEN TODAY()-2

//if monday look 3 days back to friday

ELSEIF DATEPART('weekday',[Datbuch]) = 2 THEN TODAY()-3

// otherwise look previous day

ELSE TODAY()-1

END

Hope this helps

1 of 1 people found this helpful
• ###### 5. Re: Calculation the last business day with exclude from Saturdays and Sundays

Hi Paul,