5 Replies Latest reply on Jan 31, 2016 8:37 PM by user19752

# Days Left In Month with Exclusion

Im trying to figure out how i can do this. This is my setup.

Days in Month  : User Enters Days  Ex. 31

Days Excluded in Month : User Enters Days to Exclude.  Used for holidays etc. Ex. 5

--------------------------------------------------------------------------------------------

Actual Selling Days Left in This Month = 26.

I have a field that calculates how many days are left in a month off the system clock.

Days Left in Month =  Date ( Month ( Get ( CurrentDate )) + 1 ; 0 ; Year ( Get ( CurrentDate ) ) ) - Get ( CurrentDate)

What I'm trying to do is substitute filmmaker from pulling the days off the month from the system clock and basing it off the Actual Selling Days.

How can i do this ? Basically im making a counter. So everyday im subtracting -1 from the 26.

• ###### 1. Re: Days Left In Month with Exclusion

use two custom functions, like these:

FileMaker Custom Function:WorkingDays ( DateStart ; DateEnd ; HolidayList )

FileMaker Custom Function:LastDayOfMonth

Then you can just calculate it as:

WorkingDays ( get(currentDate) ; LastDayOfMonth ; holidayList )

• ###### 2. Re: Days Left In Month with Exclusion

Are we to infer that each record in your table corresponds with a unique selling day?

If so, what happens if a user creates a record and then later deletes it?  Should your "counter" include the deleted day, or should it re-calculate based on other days in the table?

• ###### 3. Re: Days Left In Month with Exclusion

You can also get last day of month by calculation, instead of asking the user.

Date ( 3 ; 0 ; 2016 ) returns 2/29/2016, for example.

Chris Cain

Extensitech

• ###### 4. Re: Days Left In Month with Exclusion

Mike,

What am I doing wrong ?

• ###### 5. Re: Days Left In Month with Exclusion

You should change function name as "WorkingDays" and remove 4th paramter.