Solved

Crystal Reprots Formula help

Posted on 2011-09-07
8
197 Views
Last Modified: 2012-05-12
I have 5 tables and in each table a field for the Year-To-Date Sales in numbers

I created a formula that will add up all the Year-To-Date Sales from all 5 tables.

The formula works if every table has the same record but if one table does not have one record then I get nothing back.

Here is the formula. Can someone help me to make this work?
 
{NDC_WHSE.YTD_SALES}+{609_WHSE.YTD_SALES}+{BIR_WHSE.YTD_SALES}+{DUF_WHSE.YTD_SALES}+{WPG_WHSE.YTD_SALES}

Open in new window

0
Comment
Question by:Gerhardpet
8 Comments
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
In the formula editor, you should see a little box regarding how to handle nulls.

It is probably set to "Exceptions for Nulls".

Change it to "Default Values for Nulls" and your formula should work again.

See image below.

Crystal Reports Formula Editing Null Handling.
0
 
LVL 1

Author Comment

by:Gerhardpet
Comment Utility
I can't find anything. I'm on version 10...perhaps you are talking about a newer version?
0
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
In which case, you need to use the isNull(fld) function to determine if the fld is null first.

But I'm really sure that this option is there in older versions of Crystal.

0
 
LVL 1

Author Comment

by:Gerhardpet
Comment Utility
I'm not an expert in Crystal but this is what I when I try to edit a formula. Here is a sreenshoot
www.iversa.ca\files\Crystal.jpg
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 40

Accepted Solution

by:
RQuadling earned 500 total points
Comment Utility
Can you try
if isnull({NDC_WHSE.YTD_SALES}) then 0 else {NDC_WHSE.YTD_SALES}
+
if isnull({609_WHSE.YTD_SALES}) then 0 else {609_WHSE.YTD_SALES}
+
if isnull({BIR_WHSE.YTD_SALES}) then 0 else {BIR_WHSE.YTD_SALES}
+
if isnull({DUF_WHSE.YTD_SALES}) then 0 else {DUF_WHSE.YTD_SALES}
+
if isnull({WPG_WHSE.YTD_SALES}) then 0 else {WPG_WHSE.YTD_SALES}

Open in new window

0
 
LVL 19

Expert Comment

by:GJParker
Comment Utility
How are the 5 tables joined together ? Can the year-to-date field be missing from any of the 5 tables or just one.

If it can be missing from any of the 5 tables the you'll need to use FULL OUTER JOINS to join the tables together but this may not work if you have constarints in the record selection formula on any of the tables.

You'll probably have more luck if you create a command as your datasource and UNION the 5 tables together, group on the ID field in the report and you can then sum the YTD_SALES field

HTH
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
CR XI (v11) added the Drodown for the NULL issue.

Do the tables have the same structure?
If so then the union idea has some merit.

mlmcc
0
 
LVL 1

Author Closing Comment

by:Gerhardpet
Comment Utility
Thank you RQuadling. Your formula works great!!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

15 Experts available now in Live!

Get 1:1 Help Now