7 Replies Latest reply: Sep 14, 2016 5:39 AM by Gabriel Ferran

# After insert ,if(US_Cust='MYR',1/3, 1) the expression not more working

Hi All

i Have the below expression work fine :-

'S\$ ' &Num(

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1)) * days3)

+ sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1)) * days6) +

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1)) * days9) +

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1))*above12)+

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1)) * curren)

,'###,##0.00')

I try to adding one more currency for MYR :-

'S\$ ' &Num(

sum(If( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1,if(US_Cust='MYR',1/3, 1))) * days3)+

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1,if(US_Cust='MYR',1/3, 1))) * days6) +

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1,if(US_Cust='MYR',1/3, 1))) * days9) +

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1,if(US_Cust='MYR',1/3, 1)))*above12)+

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1,if(US_Cust='MYR',1/3, 1))) * curren)

,'###,##0.00')

above expression return null value , can some one advise me where i go wrong ?

Paul

• ###### Re: After insert ,if(US_Cust='MYR',1/3, 1) the expression not more working

your condition has one execution path to much

if (US_Cust='EU',1.5,1, if

if =EU then 1.5; if not EU then 1; when next if should be performed?

'S\$ ' &Num(

sum(If( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1,if(US_Cust='MYR',1/3, 1))) * days3)+

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5, 1,if(US_Cust='MYR',1/3, 1))) * days6) +

• ###### Re: After insert ,if(US_Cust='MYR',1/3, 1) the expression not more working

Hi Rudolf

Thank you very much

PAul

• ###### Re: After insert ,if(US_Cust='MYR',1/3, 1) the expression not more working

May be as below:

'S\$ ' &Num(

sum(If( US_Cust='USD', 1.3,if(US_Cust='EU',1.5,if(US_Cust='MYR',1/3, 1))) * days3)+

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5,if(US_Cust='MYR',1/3, 1))) * days6) +

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5,if(US_Cust='MYR',1/3, 1))) * days9) +

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5,if(US_Cust='MYR',1/3, 1)))*above12)+

sum(If ( US_Cust='USD', 1.3,if(US_Cust='EU',1.5,if(US_Cust='MYR',1/3, 1))) * curren)

,'###,##0.00')

• ###### Re: After insert ,if(US_Cust='MYR',1/3, 1) the expression not more working

Paul,

i think the brakets are not ok. Look at this:

the second if has three options! I have worked with your first if sentence.

Regards,

Gabriel

• ###### Re: After insert ,if(US_Cust='MYR',1/3, 1) the expression not more working

Try to write full expression instead of days3,6,9,12, curr

• ###### Re: After insert ,if(US_Cust='MYR',1/3, 1) the expression not more working

Hi Anil

I think you got the point , as now i need to more condition , i find it hard to handle , are you able to share the how to simplify the below expression :-

'S\$ ' &Num(

sum(If ( US_Cust='USD', 1.3,If ( US_Cust='MYR', 1/3,if(US_Cust='EU',1.5, 1))) * days3)

+ sum(If ( US_Cust='USD', 1.3,If ( US_Cust='MYR', 1/3,if(US_Cust='EU',1.5, 1))) * days6) +

sum(If ( US_Cust='USD', 1.3,If ( US_Cust='MYR', 1/3,if(US_Cust='EU',1.5, 1))) * days9) +

sum(If ( US_Cust='USD', 1.3,If ( US_Cust='MYR', 1/3,if(US_Cust='EU',1.5, 1)))*above12)+

sum(If ( US_Cust='USD', 1.3,If ( US_Cust='MYR', 1/3,if(US_Cust='EU',1.5, 1))) * curren)

,'###,##0.00')

So that it is easy for me to manage.

Paul

• ###### Re: After insert ,if(US_Cust='MYR',1/3, 1) the expression not more working

Hi Anil

I try and i get it :-

'S\$ ' &Num(

sum(If ( US_Cust='USD', 1,If ( US_Cust='MYR', 1/3,if(US_Cust='EU',1.5, 1))) * curren+days3+days6+days9+above12)

,'###,##0.00')

Paul