Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can i create expression with if command?

Hi,

Please help me to create the following expression in my project, even expression shows the status OK, it does not woks.

SUM(IF('BRO_COMM'=0 AND 'AGE_COM'=0 AND 'GRO_COM'=0,(COM_PRE*ME_COM+SR*ME_RS+TC*ME_TC)/100))

regard,

Priyantha.

11 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression in front end

=Alt(Sum({<BRO_COMM={0}, AGE_COM = {<0>}, GRO_COM = {0}>} PREMIUM) *0.05, 0)

If you want to do this calculation in script then try this

LOAD

*,

If(BRO_COMM=0 AND AGE_COM=0 AND GRO_COM = 0, PREMIUM * 0.05, 0) AS ME_COM

FROM DataSource;


Hope this helps you.


Regards,

Jagan.

Anonymous
Not applicable
Author

Try this:

IF((BRO_COMM=0 AND AGE_COM=0 AND GRO_COM=0),((COM_PRE*ME_COM)+(SR*ME_RS)+(TC*ME_TC))/100,0)


or  you may try below


if (BRO_COMM=0,if(AGE_COM=0,if(GRO_COM=0,((COM_PRE*ME_COM)+(SR*ME_RS)+(TC*ME_TC))/100,0)))


Mark the Question as answered, if any one's answer is works for you.


Regards,

Chinna