Solved

previos month value in Crystal Report

Posted on 2008-10-23
5
222 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

861 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