Solved

Summarized a Group calculation

Posted on 2006-10-24
3
550 Views
Last Modified: 2012-06-21
Crystal 9.0
I want to perform a calc (see “@Compare” formula below) on Group 4 subtotals.  I’d like to sum the result of this calc "@Compare" in the higher groups (Group 1, Group2, Group 3).
I am unable to use the Crystal’s Summary function (I assume because the result of “@Compare formula” is in a group section and not in the detail section).   Same problem with running total.   “@Compare” is not available to summarize.

@Compare formula = If column A> Column B then Column A else Column B

Example Groups and Sections
                Column ID:        A                   B                      C

Group 1 – Job  Subtotal                        Group #1 CC sum of @Compare formula      
Group 2 – CSI  Subtotal                        Group #2 CC sum of @Compare formula
Group 3 – CC   Subtotal                        Group #3 CC sum of @Compare formula
Group 4 – Cat   Subtotal                        @Compare formula
Detailed Trans  Section                   


Also - Users want to drill down to the “Detailed Trans” level
Can somebody recommend a direction?  My other attempts (in progress):
1. A subreport to summarize the “Detail Trans” section and pass Cat Subtotals from subreport to Main.    This will allow my main report’s detail section to be “Cat” thus allowing Crystal summary.
2. A formula in the detail section that summarizes amounts base on Cat value.  Link an “On Demand Subreport” if the user needs to drill down to detailed trans level.
0
Comment
Question by:LFreehauf
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 17797847
WHat is the @Compare Formula?

mlmcc
0
 

Author Comment

by:LFreehauf
ID: 17798079
The formula (referred to as "@Compare formula")  is a simple 'if ...then'.  Using the examples above, it's  (If Column A> Column B then Column A else Column B

The actual cut and paste is
((if Sum ({@Total Estimate}, {JCT_CURRENT__TRANSACTION.Category}) > Sum ({@Total Commitment}, {JCT_CURRENT__TRANSACTION.Category})
then Sum ({@Total Estimate}, {JCT_CURRENT__TRANSACTION.Category}) else Sum ({@Total Commitment}, {JCT_CURRENT__TRANSACTION.Category}))
)

It takes the greater of Estimated $ vs. Commitment $ for each line in group 4.  With this formula in Group 4, I cannot perform the simple "Insert>Summary>" in higher groups.  The formula is not available for Summary via "Insert>Summary>"

0
 
LVL 42

Accepted Solution

by:
frodoman earned 350 total points
ID: 17798911
This formula won't be available for summary because of the if..else.  What you can do is store the results in a variable and then show that variable at higher levels.  In simple form it would look like this:

// @Compare
shared numberVar myTotal;
numberVar thisResult;
if ColumnA > ColumnB then
   thisResult := Sum(ColumnA, GroupBy)
else
   thisResult := Sum(ColumnB, GroupBy);

myTotal := myTotal + thisResult;
thisResult;

Now in the other groups you can create a formula to show the variable value:

// @ShowValue
shared numberVar myTotal;

If you need to reset the variable simply create a new formula in the appropriate section to set it to zero.  If you want to reset at different levels you may need to use multiple variables.

frodoman
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
Display group header even if no detail records 9 64
Horizontal Lines in crystal reports 6 69
Crystal Reports Sub Report 4 79
Crystal Reports CSV data source, field types 6 61
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

21 Experts available now in Live!

Get 1:1 Help Now