Calculate total days between start and end date without weekend

0
Hi, I would like to calculate the total days between start and end date but exclude the weekend date (Saturday and Sunday) How to implement this formula? My formula right now : floor(daysBetween($CarbonNeutralInputData/StartDate,$CarbonNeutralInputData/EndDate) Anyone know? Thanks
asked
3 answers
0

This is fork of Abhisheks answer :) Nearly same as his logic but the date functions are a little changed.

I use formatDateTime to get the Day of the week from the date and then work with it till end date, all the time checking for weekend(assuming weekend on Sat and Sun)


Download this Microflow export, import and and use/modify as per your needs.
https://drive.google.com/file/d/1LRYLzDlsk6zXgUj8DeyoCjRopHO_MD5j/view?usp=sharing

answered
4

Hello Muhammad,

Implementing this function using a formula might be complicated but you can achieve your requirement using loop.

Let me explain in steps;
1. Create a variable of type date with initial value as start date and create a count variable.
2. Check if the trimtoday($variable) = 1 or 7.
3. If true continue the loop by using change variable by add date 1.
4. Else increment the count.
5. This loop will execute until variable < end date.
6. The count variable will be the days between start and end.

Hope my answer helps. Reach me out for any queries.

answered
0

Hi Muhammad,

 

You can try this https://marketplace.mendix.com/link/component/116770 to see if it meets your requirement.

 

Huy

answered