Solved

previos month value in Crystal Report

Posted on 2008-10-23
5
219 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

13 Experts available now in Live!

Get 1:1 Help Now