Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group By Week

Status
Not open for further replies.

sgk17

Technical User
Nov 8, 2002
68
US
I need to do a report that takes today's date and shows this weeks sales totals compared with last years sales totals during the same week. For example, since today is Wed 2/19 the report would show:

Sun 2/16/2003 Mon 2/17/2003 Tues 2/18/2003....Sat 2/22/2003
Sales Totals Sales Totals Sales Totals......Sales Totals


Sun 2/17/2002 Mon 2/18/2002 ..................Sat 2/23/2002
Sales Totals Sales Totals ..................Sales Totals

I'm not sure how to match the two years up so we can compare Sunday of this year to Sunday of last year since the date changes and it changes even more on leap year. I'm really not sure of the best way to do any of it. Any pointers would be appreciated. Thanks
 
Create a formula containing:

datepart("ww",{table.date})

Group on this

Insert a group inside this based on the date, and change the This Section Will Be Printed to For Each Year.

This gets you close, you might also create a formula using dayofweek to get a grouping going by the day, so that you can use a previous() function to do comparisons, I have to run so I can't flesh it out right now.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top