Solved

previos month value in Crystal Report

Posted on 2008-10-23
5
224 Views
Last Modified: 2012-06-27
Hello

I have got a crystal report looking as follow

Grouplevel                             Revenue | Margin
GH1 Country        
GH2 Customer (drill)

The user selects a specific month as parameter.

So I now want to ad a column showing the revenue of last month.
I already managed to get this partially work, using shared variables. In the data selection i select the current month as well as the previous month and then I added a group "month". With the shared variables I pulled the last months values and displayed them at the country group for the current month. My problem comes with the drill functionality. If I drill down to the customer level, I loose the previous month value on the country group, which is logical to me because the drill creates a new SQL-query specifically for the current month. So there can be no value. I am looking for hours to find a solution for this, but could not find anything appropriate. Using additional data sources as described  in other solutions is not an option because I am working on Business-Views, which make this difficult.

I am looking forward to hearing from you
0
Comment
Question by:mschmitz
  • 2
  • 2
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22792052
Try this idea.

Add 2 formulas
PreviousMonth
If {DateField} In LastFullMonth then
    {RevenueField}
else
     0

Similarly for the current month

You can then use those formulas to get your summaries for the country and you don't need to group by the date.

mlmcc
0
 

Author Comment

by:mschmitz
ID: 22794130
Yep, I had such an Idea as well,
but as my report gets bigger (more columns), I would need to create a formula for each column on each group level (otherwise the grouping will not be done on the server).
I will create reports like that using more than 10 columns, so this will result in much formulas which is not very good for maintenance.
Do you have any other ideas?
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 22796430
The only other way I can think of would be to use a subreport to get the previous month data but not sure what happens when you drill in.

mlmcc
0
 

Author Closing Comment

by:mschmitz
ID: 31509457
Not what I was looking for but thanks for the help
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

697 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