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
283 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 35

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

733 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