Solved

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

Posted on 2014-04-28
2
2,059 Views
Last Modified: 2014-04-28
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})

Open in new window


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
Comment
Question by:Mchallinor
2 Comments
 
LVL 100

Accepted Solution

by:
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

by:Mchallinor
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now