Solved

Is it possible in Crystal Reports XI to Graph Formulas that use a running total or variable?

Posted on 2009-05-08
4
591 Views
Last Modified: 2013-11-15
I need to graph a formula that I has a running total or vaiable in it.  Is this possible?

I have the following database fields and running totals.

Database Fields:
Costcode, Tran_Date , Total_Theory
I have these grouped by date and have created a running total on Total Theory.  However my graph needs to show by Week, the value of (RUnning Total) / database field Budget.  Can't seem to graph this.

Hope this makes since and will be very appreciative of suggestions.
0
Comment
Question by:Gar_za
  • 2
  • 2
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24340121
Yes through a trick.  Charts cannot use running totals since they are calculated after the charts are built.  HOwever since subreports are run at during the last pass through the report you can build arrays with the data and pass the data to the subreport.

Check this link
 https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40e7130d-aa1e-2b10-ce9f-eee2a54ff4cd

mlmcc
0
 

Author Closing Comment

by:Gar_za
ID: 31579603
I feel like I just won the lottery with this information.  Thank you.  This is exactly what I needed to get my graphs to work!
0
 

Author Comment

by:Gar_za
ID: 24341335
Ok, so got this to work when the On change is a text field.  How do I do it if the OnChange is a date field?

My On change Of  Variable has the following formula in the main report:
whileprintingrecords;
stringvar strOnChangeOf;
strOnChangeOf := strOnChangeOf + totext({cstcddtl.TRAN_DATE})+"," +"^";

When I go to the selection formula to Select CSTCDDDTL.Tran_Date base on Onchange i have the following:
{cstcddtl.TRAN_DATE} in Cdate(Split({?Pm-@OnChangeOf}, "^") [RecordNumber])

When I do this I get an error stating that "A date range is required here".
How do I make this a date range so that the selection formula will work?

Thanks
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24341468
I believe you can only use the trick through string fields because the JOIN only works on string arrays

In the main report when you add it to the array change the date to a string as
   CStr({DateField},'yyyy/mm/dd')

When you need them in the subreport convert them back
    Date(YourArray[i])

mlmcc
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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…
Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
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…

773 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