Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT help needed 1

Status
Not open for further replies.

pungigi

Programmer
Oct 29, 2003
115
US
I have a report with several formulas and fields, what I need is to be able to say "add this and this\that" when I do this I keep getting a zero division error, I can't figure out how to say "if 0 suppress or don't include" Can anyone help me???
 
the basic format for doing what you want, I think (giving a specific example would be more helpful), is:

If {denomiatorField} <> 0 then
{Field1}/{denominatorField}
 
SORRY, stupid of me, here is my formula currently.

({@Comp $ Paid}+{@NS $ Paid})/{@Total Trips}

@Total Trips can be zero but I don't want it to show if it is.
 
You still need to use the formula layout that FVTrainer specified so that you don't get the error.
Code:
If {@Total Trips} <> 0 then
  ({@Comp $ Paid}+{@NS $ Paid})/{@Total Trips}
Else
  0

Now conditionally suppress this formula when {@Total Trips} = 0

~Brian
 
Ok, now I am really stuck, here goes. I have the following formula

if {@Avg Cost}<={@Rank Avg Cst}
then 1
else if {@Avg Cost}<=({@Rank Avg Cst}*1.1)
then 2
else if {@Avg Cost}<=({@Rank Avg Cst}*1.2)
then 3
else if {@Avg Cost}<=({@Rank Avg Cst}*1.3)
then 4

Here is the @avg Cost formula
if {@Total Trips}<>0
then ({@Comp $ Paid}+{@NS $ Paid})/{@Total Trips}
else 0

Here is the @ rank Avg cost formula
{@Rank Cost}/{@Rank Count}

What I am wanting is the following:
Average Cost Ranking
VDR ABC 34.56 1
VDR DEF 38.97 2
VDR GHI 45.62 3

STATE AVG 39.71

With my 1st formula above I am trying to rank the individual vendors based on the % they are within the state average. What doesn't seem to work is the @avg cost formula but ONLY in the 1st formula.
 
this is not the same problem....post it as another problem

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top