4 Replies Latest reply on Mar 21, 2012 4:24 PM by MarkRingwald

# Creating a sub summary of data by weeks that begin on Monday

### Title

Creating a sub summary of data by weeks that begin on Monday

### Post

I am pretty new at this and searched the forum where I came up with this calculation for a field I called Weekly:

DateField - DayofWeek(DateField) + 2  for a Monday-Sunday week.

I created Sub-summary report based on this field and sorted it by that field. It works except that it includes the Sunday prior to the Monday I want the week to begin with. Is there a way to get Filemaker to recognize Monday as the first day in the week?

• ###### 1. Re: Creating a sub summary of data by weeks that begin on Monday

Let ( dw = DayofWeek(DateField) ; DateField - dw + 2 - 7 * (dw = 1 ) )

• ###### 2. Re: Creating a sub summary of data by weeks that begin on Monday

Thanks for the prompt reply, and again pardon my newbie-ness, but if "DayofWeek(DateField) ; DateField - dw + 2 - 7 * (dw = 1 )" is a single calculation, then filemaker is expecting an operator somewhere after the semi-colon.

• ###### 3. Re: Creating a sub summary of data by weeks that begin on Monday

It is not a single calculation

dw = DayOfWeek(DateField )

is one expression and DateField - dw + 2 - 7 * (d2 = 1 )

is another. These make up two parameters to the let function so the entire expression should be:

Let ( dw = DayofWeek(DateField) ; DateField - dw + 2 - 7 * (dw = 1 ) )

exactly as I posted it except you subsitute the name of your date field for "datefield" in the two places it is referenced in this calculation.

• ###### 4. Re: Creating a sub summary of data by weeks that begin on Monday

Works. Brilliant. Thanks