Solved

Crystal cannot sum formula

Posted on 2010-11-10
5
238 Views
Last Modified: 2012-05-10
IF {Z_MEV_MONTH.ComponentItemNumber} = "120001" Then
((({Z_MEV_MONTH.NewProduction}* 0.47) - ({Z_MEV_MONTH.DeltINV}* -1)) * 0.26)
Else If  {Z_MEV_MONTH.ComponentItemNumber} = "81009" Then
((((({Z_MEV_MONTH.DeltINV}/({@Total ASA}*0.3) * 0.6411) * {Z_MEV_MONTH.NewProduction})*-1) - ({Z_MEV_MONTH.DeltINV}* -1)) * .311)
Else If {Z_MEV_MONTH.ComponentItemNumber} = "81010" Then
((((({Z_MEV_MONTH.DeltINV}/({@Total ASA}*0.3) * 0.6411) * {Z_MEV_MONTH.NewProduction})*-1) - ({Z_MEV_MONTH.DeltINV}* -1)) * .311)

Will not sum
0
Comment
Question by:jessebrannen
5 Comments
 
LVL 9

Expert Comment

by:wellhole
ID: 34104017
Make sure that the values in your maths are all numeric. Crystal may have trouble if any value it reads is null. Either goto the file menu and set all database nulls to default values, or catch these suckers and handle them.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34104111
I suspect the problem is this formula field
{@Total ASA}
Judging from the name it looks like this might be doing a calculation across multiple records.
If so then it probably can't be used in a formula which is summed.

You  would have to use variables and build your own sum as you go.
0
 

Author Comment

by:jessebrannen
ID: 34104556
having trouble with variables

Whileprintingrecords;

Global CurrencyVar Tot;

Tot = Tot + IF {Z_MEV_MONTH.ComponentItemNumber} = "120001" Then
((({Z_MEV_MONTH.NewProduction}* 0.47) - ({Z_MEV_MONTH.DeltINV}* -1)) * 0.26)
Else If  {Z_MEV_MONTH.ComponentItemNumber} = "81009" Then
((((({Z_MEV_MONTH.DeltINV}/({@Total ASA}*0.3) * 0.6411) * {Z_MEV_MONTH.NewProduction})*-1) - ({Z_MEV_MONTH.DeltINV}* -1)) * .311)
Else If {Z_MEV_MONTH.ComponentItemNumber} = "81010" Then
((((({Z_MEV_MONTH.DeltINV}/({@Total ASA}*0.3) * 0.6411) * {Z_MEV_MONTH.NewProduction})*-1) - ({Z_MEV_MONTH.DeltINV}* -1)) * .311)

just returns True or False???
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 34105739
You are in Crystal syntax for the formula. Assignment is done with :=. The = is used for comparison

Change the first line to
Tot := Tot + IF {Z_MEV_MONTH.ComponentItemNumber} = "120001" Then

mlmcc
0
 

Author Comment

by:jessebrannen
ID: 34106553
Thank you!!!! Syntax, sytax, syntax.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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

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

12 Experts available now in Live!

Get 1:1 Help Now