[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How to call on a Variable in a formula.

Posted on 2011-04-25
Medium Priority
Last Modified: 2012-12-26

I am using this to total some information and eliminate duplicates. However, I need to use the totals being produced within the footer section in a formula. If I browse that field it shows zero, even though when placed in the footer it does give the correct total..

Also, I also need to be able to average an unsuppressed field in my details. Can this be done using the same method, variables?

Thanks.. P.S. I am very much not liking having to create all these fomulas just to sum my unsuppressed fields.. If there is an easier way to do this please someone tell me! I can't figure out why Crystal would not have incorporated this feature! :(

Question by:SeyerIT
LVL 101

Assisted Solution

mlmcc earned 900 total points
ID: 35462818
>> I can't figure out why Crystal would not have incorporated this feature!
If you can tell them how to do it then I am sure they would be happy to incorporate it into the next version.

Footer formula
Global NumberVar Group1Total;
Global NumberVar Group3Total;
Global NumberVar GrandTotal;
Use the variable/total you want

LVL 35

Accepted Solution

James0628 earned 1100 total points
ID: 35465719
Another option would be to use running totals.  You have more control over those than regular summaries.  Right-click on the field/formula in the detail section and select Insert > "Running Total".  Under Evaluate, click "Use a formula" and then click the formula (X+2) button and enter the reverse of your suppression formula:

NOT (Not OnFirstRecord And {@CurrentCost} = Previous({@CurrentCost}) And
 {BAQReportResult.JobMtl.AssemblySeq} = Previous({BAQReportResult.JobMtl.AssemblySeq}))

 If it's a group total, use the "On change of group" option under Reset to reset that total for each new group.

 CR will probably put the running total field in the detail section.  Just move it wherever you want it.

 I wasn't sure if you'd be able to use OnFirstRecord or Previous in a running total like that, but I just tried it here and it seemed to work fine.

 You can do the average the same way.  CR seems to only include the "non-suppressed" records when calculating the average.

 You still have to enter the reverse of your suppression formula in each running total, but maybe you'll find that easier than using formulas and variables.


Author Comment

ID: 35466435
mlmcc: I only wish I knew more about these programs to make such a suggestion :) I know how I would like to see it work.. Probably have a checkbox in the Section Expert that would say something like, checked to ignore suppressed values in calculations or unchecked to calculate suppressed values.. It just seems like that would save a lot of time.. I guess it will be different as I get to know the software better..

Aside from my bickering about the software :)

James your method is definitely easier to work with and for me to understand. Nonetheless either will work.. At least I know there is an alternative to the variables.. I'm sure in due time I will have a much better handle on those though..

Let me work with this now for a bit and I'm sure I will be back later today with more questions... Creating this report is definitely proving to be a challenge.. But I will say that I am learning A LOT in the process!

Thanks again guys!
LVL 35

Expert Comment

ID: 35489939
 > Probably have a checkbox in the Section Expert that would say something
 > like, checked to ignore suppressed values in calculations or unchecked to
 > calculate suppressed values.

 That's actually an interesting idea.  I don't know how often it would really be needed by CR users in general, but it seems doable and would certainly be useful at times.

 FWIW, there are some things that running totals just can't handle, so if you work with CR very much, you'll probably need to use variables sooner or later.  But if running totals give you what you need, I see no reason not to use them.


Expert Comment

ID: 38721400

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

872 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