Solved

How do I use a percent that uses a running total in a line chart for Crystal Reports?

Posted on 2014-11-20
4
257 Views
Last Modified: 2014-11-21
Using the following formula for a running percentage:
@newPercent:
If Sum ({Command.Principal}, {Command.ActualLoanDate}, "annually") = 0
then 0
else
{#Amount} / Sum ({Command.Principal}, {Command.ActualLoanDate}, "annually")

#Amount is a running total with description attached as a word document below



Cannot use
0
Comment
Question by:plainwrapname
  • 2
4 Comments
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 333 total points
ID: 40455742
As you found out you can't use running totals inn charts.

Crystal uses a multiple-pass process to render the report.  Charts are created in I believe pass 2 while running totals are calculated in pass 3 (last pass through the report)

Therefore the values of a running total are not known when the chart is created.

What are you trying to show using the running total?

mlmcc
0
 

Author Comment

by:plainwrapname
ID: 40455821
I am trying to calculate an accumulated percentage based on a running total for each period.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 333 total points
ID: 40455952
You then want to graph the results?

The easy way may be to write a stored procedure that can return the data summarized as you desire.

There are some tricks that can allow a subreport to build the chart but they depend on the data you have so it may not be very easy to get it setup.

mlmcc
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 167 total points
ID: 40457017
FWIW, I don't see anything attached to your first post.  If we could see how the running total is set up, we might be able to suggest a different way to get that figure, which could be used in a chart.  From what you've said, I rather doubt it, but we won't know until we see it.

 Other than that, since you're apparently already using a CR Command, maybe you could modify that query to calculate the running total, so that CR won't have to do it.

 James
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

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

17 Experts available now in Live!

Get 1:1 Help Now