Solved

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

Posted on 2009-05-08
4
580 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

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…
Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

15 Experts available now in Live!

Get 1:1 Help Now