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

x
?
Solved

How can I get around the "A field is required here" in Crystal XI

Posted on 2010-01-05
7
Medium Priority
?
1,365 Views
Last Modified: 2012-05-08
For flexibility I'm trying to include an If Then Else statement inside a sum() function but I'm getting the error message: "A field is required here". Any tricks on how I can get around this? Sometimes I use totext() or tonumber() to get around similar error messages.

Here is my example:
sum (
if {field} = "Y"
then {amount}
else 0
        )

Thanks!
David
0
Comment
Question by:dking_wri
7 Comments
 

Expert Comment

by:ansvarit
ID: 26186666
Would this work;

If {field}="Y" Then
  Sum({amount})
Else
  0;
0
 
LVL 35

Expert Comment

by:James0628
ID: 26187428
Create a formula with

if {field} = "Y"
then {amount}
else 0


 You should be able to use Sum on that formula.

 James
0
 
LVL 16

Expert Comment

by:wykabryan
ID: 26190104
yeah, james's solution is correct. Make sure that you put it in the detail line so that you can right click and insert summary.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 

Author Comment

by:dking_wri
ID: 26190332
Thanks for your comments. I was trying to avoid using a summary object and thought that there might be a trick to get around this in a single formula. I need to create a second formula that tests for a "N" value and thought I could just duplicate and modify the formula as opposed to creating 4 objects ( two formulas and two summaries)
0
 
LVL 35

Accepted Solution

by:
James0628 earned 1500 total points
ID: 26192227
Two formulas and two summaries don't seem like that big a deal, and I'm not sure exactly what you're trying to do, but you could also consider using running totals.  Maybe they'd better suit your needs.  For example, for your original problem, you could create a running total on {amount} and set it to evaluate when {field} = "Y".

 James
0
 

Author Closing Comment

by:dking_wri
ID: 31673256
Hello James,
You are correct that two formulas and two summaries is not a big deal but I need to then replicate this process across 50 different objects which creates a 100 new formulas in my report. I was trying to minimize this number. I'll also try the running totals as you suggested. Thanks for your help!
0
 
LVL 35

Expert Comment

by:James0628
ID: 26192444
I thought there might be more to it than just 2 formulas and summaries, but, of course, had no way to be sure.  I'm afraid you may just be stuck with having to create a lot of different objects.  FWIW, you can do things like copy the contents of one formula and paste them into another, which may help a little.

 James
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
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. …

873 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