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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested Formula Issue 1

Status
Not open for further replies.

briesen

Technical User
May 13, 2008
24
0
0
US
I have a fairly simple nested formula, but I'm struggling to get the correct format. I know that the formula at the end is redundant, but I was just trying to figure out how to get it to work.

Code:
Round
(if isnull({tei.dteFileCreated}) then
if {vtr.Mode}="LTL" 
then ({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.37+{vtr.curARAddedFee} 
else 
if {vtr.Mode}<>"TL" 
THEN ({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.1+{vtr.curARAddedFee}) 
ELSE 
IF {vtr.Mode}="TL" 
THEN ({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.23+{vtr.curARAddedFee})
else if NOT isnull ({tei.dteFileCreated}) then {tei.curARAmtwMarkup}+{tei.curFee},2)
 
there may be other things, but the first one i noticed is you are missing parenthesis at the end to close out the statements.

Round
(if isnull({tei.dteFileCreated}) then
(if {vtr.Mode}="LTL"
then ({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.37+{vtr.curARAddedFee}
else
(if {vtr.Mode}<>"TL"
THEN (({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.1+{vtr.curARAddedFee})
ELSE
(IF {vtr.Mode}="TL"
THEN (({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.23+{vtr.curARAddedFee})
else
if NOT isnull ({tei.dteFileCreated}) then {tei.curARAmtwMarkup}+{tei.curFee},2)))))
 
Assuming that all of the 'ifs' belong to the isnull condition, then it should look like:

if isnull({tei.dteFileCreated}) then
(
if {vtr.Mode}="LTL"
then ({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.37+{vtr.curARAddedFee}
else
if {vtr.Mode}<>"TL"
THEN ({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.1+{vtr.curARAddedFee}
ELSE
IF {vtr.Mode}="TL"
THEN ({vtr.TotalARAmt}-{vtr.curARAddedFee})*1.23+{vtr.curARAddedFee}
) else
if NOT isnull ({tei.dteFileCreated}) then
{tei.curARAmtwMarkup}+{tei.curFee}

Not sure what this is supposed to be:

{tei.curFee},2

...so I just removed the comma and 2.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top