Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I get the following error:
Error in expression:If takes 2-3 parameters....
Below is the code in the load script. I see the red "(" but cannot get it to work if i add another closing bracket
if("Sale Finalized" = 'Yes', ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons]),
if("Sale Finalized" = 'No',
if(("SubSale Deal Type Text"='Consignment') and ("Sale Deal Type Text" = 'Consignment') and (Producer = 'Fruit Pool'), ([FOB?EXW]*0.04),([FOB?EXW] * 0.08),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'Ex Works' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price" - ([L-Transport]*[No Cartons])-
([L-Insurance]*[No Cartons]) - ([L-Marine Insurance]*[No Cartons])),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'CIF' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'FOB' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'DIP' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Consignment' , ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons])))))))) as Profit
Please help!!!
Seems you lost here in your exp, here true and false both evaluating so that the expression ends here, please try to evaluate once you expression
else post an sample app to look into it with expected outut
if("Sale Finalized" = 'Yes', ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons]),
if("Sale Finalized" = 'No',
if(("SubSale Deal Type Text"='Consignment') and ("Sale Deal Type Text" = 'Consignment') and (Producer = 'Fruit Pool'), ([FOB?EXW]*0.04),([FOB?EXW] * 0.08),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'Ex Works' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price" - ([L-Transport]*[No Cartons])-
([L-Insurance]*[No Cartons]) - ([L-Marine Insurance]*[No Cartons])),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'CIF' , ("ExWorks Selling" - "Exworks CostX" -"L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'FOB' , ("ExWorks Selling" - "Exworks CostX"- "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'DIP' , ("ExWorks Selling" - "Exworks CostX"- "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Consignment' , ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons])))))))) as Profit
Hi,
Try this:
if("Sale Finalized" = 'Yes', ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons]),
if("Sale Finalized" = 'No',if(("SubSale Deal Type Text"='Consignment') and ("Sale Deal Type Text" = 'Consignment') and (Producer = 'Fruit Pool'), ([FOB?EXW]*0.04),([FOB?EXW] * 0.08)),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'Ex Works' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price" - ([L-Transport]*[No Cartons])-
([L-Insurance]*[No Cartons]) - ([L-Marine Insurance]*[No Cartons])),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'CIF' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'FOB' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'DIP' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Consignment' , ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons]))))))))
HTH
Sushil
Seems you lost here in your exp, here true and false both evaluating so that the expression ends here, please try to evaluate once you expression
else post an sample app to look into it with expected outut
if("Sale Finalized" = 'Yes', ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons]),
if("Sale Finalized" = 'No',
if(("SubSale Deal Type Text"='Consignment') and ("Sale Deal Type Text" = 'Consignment') and (Producer = 'Fruit Pool'), ([FOB?EXW]*0.04),([FOB?EXW] * 0.08),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'Ex Works' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price" - ([L-Transport]*[No Cartons])-
([L-Insurance]*[No Cartons]) - ([L-Marine Insurance]*[No Cartons])),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'CIF' , ("ExWorks Selling" - "Exworks CostX" -"L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'FOB' , ("ExWorks Selling" - "Exworks CostX"- "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'DIP' , ("ExWorks Selling" - "Exworks CostX"- "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Consignment' , ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons])))))))) as Profit
The bit is red below is an if with 4 parameters, which will give the error you are getting.
if("Sale Finalized" = 'Yes',
([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons]),
if("Sale Finalized" = 'No',
if( ("SubSale Deal Type Text"='Consignment') and ("Sale Deal Type Text" = 'Consignment') and (Producer = 'Fruit Pool'),
([FOB?EXW]*0.04),
([FOB?EXW] * 0.08),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'Ex Works' ,
("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price" - ([L-Transport]*[No Cartons])-([L-Insurance]*[No Cartons]) - ([L-Marine Insurance]*[No Cartons])),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'CIF' ,
("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'FOB' ,
("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'DIP' ,
("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Consignment' ,
([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons]))))))))
as Profit
The mistake begins at the row:
if(("SubSale Deal Type Text"='Consignment') and ("Sale Deal Type Text" = 'Consignment') and (Producer = 'Fruit Pool'), ([FOB?EXW]*0.04),([FOB?EXW] * 0.08),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'Ex Works' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price" - ([L-Transport]*[No Cartons])-
([L-Insurance]*[No Cartons]) - ([L-Marine Insurance]*[No Cartons])),
the correct syntax is:
If(condition, Cond.True,
If(condition, Cond.True,
cond.false
)
)
That did not work...but I found the problem via te other guys responses...
yeah,,,lack of sleep makes you type weird stuff
yeah,,,lack of sleep makes you type weird stuff
yeah,,,lack of sleep makes you type weird stuff
and it now looks like this:
if("Sale Finalized" = 'Yes', ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons]),
if("Sale Finalized" = 'No',
if(("SubSale Deal Type Text"='Consignment') and ("Sale Deal Type Text" = 'Consignment') and (Producer = 'Fruit Pool'), ([FOB?EXW]*0.04),//([FOB?EXW] * 0.08),
if(("SubSale Deal Type Text"='Consignment') and ("Sale Deal Type Text" = 'Consignment') and (Producer <> 'Fruit Pool'), ([FOB?EXW]*0.08),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'Ex Works' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price" - ([L-Transport]*[No Cartons])-
([L-Insurance]*[No Cartons]) - ([L-Marine Insurance]*[No Cartons])),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'CIF' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'FOB' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Fixed' and "Selling Cost Type" = 'DIP' , ("ExWorks Selling" - "Exworks CostX" - "L-FinanceX" - "L-AdminX" - "Fixed Purchase Price"),
if("SubSale Deal Type Text" = 'Consignment' , ([L-Idea Commission] * [No Cartons]) + ([L-Margin]*[No Cartons])))))))))) as Profit