Uderc programming article aggregator sites

How to find current month, previous month Net Sales by means of formula?

Tags:
Answers: Have 3 answers
Advertisement
Hello Gurus,
I need my crystal report to display data as below:-
                                        Net Sales
PG1         Current month      Previous Month     Prior year-month    %Variance
Panels      $                          $                          $
Frames
Can anyone kindly suggest formula for generating these values?
I have already formulated current, previous, prior year months' start dates and end dates.
Further details:-
Data filters are requested for Company-->Region-->Customergroup-->All Product group
Datasource is Universe
Reporting for 2 years data
Your suggestions and help will be much appreciate.
Thanks,
Prarthana
Advertisement
The best answer: hi Prarthana,
there are a couple of different ways of doing this...one way is to create formulae similar to below...
1) formula for current month sales
if month({your date field}) = month(currentdate)
and year({your date field}) = year({your date field})
then {your sales field}
2)  formula for previous month sales
if month({your date field}) = month(dateadd("m", -1, currentdate))
and year({your date field}) = year(dateadd("m", -1, currentdate))
then {your sales field}
3) formula for 2 months ago
if month({your date field}) = month(dateadd("m", -2, currentdate))
and year({your date field}) = year(dateadd("m", -2, currentdate))
then {your sales field}
put those formulas on your details sections and then right click on them and choose Insert > Summary and choose Sum as the summary type and change the Summary Location to match the appropriate groups.
cheers,
jamie