Solved

# Crystal Reports SubTotals , YTD Sales, MTD Sale and Week Sales on the same report

Posted on 2014-04-28
2,242 Views
Dear all,

I'm curious about how to achieve what I thought was a simple report showing Sales Year to Date, Month to Date and Week to Date.
All displayed on one Group Footer.

The best way to explain what I'm trying to achieve is attached below in the image.

I've been working with the Crystal Formula. e.g.
`````` Sum({Sales in GBP},{@Sales Month})
``````

I guess need to create the following groups:

Group 1 =  Customer
Group 2 =  Sales Year
Group 3 =  Sales Month

Then using the today() formula I can work out how make a record selection for Year(SalesDate) = Year(Today())
Year to day Sales Total is quite easy.

But then how do I put on the same group footer the Month to Date total?
Then finally the Week to Date total on the same group footer?

I need some pointer in case I'm going about his in completely the wrong way.
Should I be using Running totals?

Thanks
mchallinor
Report-Layout.png
0
Question by:Mchallinor
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 100

Accepted Solution

mlmcc earned 500 total points
ID: 40027185
Crystal has prebuilt date range functions

YTD

If {SalesDate} IN YearToDate then
{SalesAmount}
Else
0

MTD
If {SalesDate} IN MonthToDate then
{SalesAmount}
Else
0

WTD
If {SalesDate} IN WeekToDateFromSun then
{SalesAmount}
Else
0

You can also use
LastFullWeek
Last7Days

The above formulas can be used in summary functions to get the total

mlmcc
0

Author Comment

ID: 40027242
Wow,  How have I not used this formula before!   Thank you so much.
I thought it would be easy, but that is crazy simple.

Cheers
mchallinor
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
###### Suggested Courses
Course of the Month2 days, 16 hours left to enroll