Solved

previos month value in Crystal Report

Posted on 2008-10-23
5
220 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Report Sorting/Grouping 4 65
Combine and display field 5 72
Change start of Week from Sunday to Friday 8 47
Date is within the current week in Crystal Reports 2 46
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.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

943 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

1 Experts available now in Live!

Get 1:1 Help Now