cancel
Showing results for 
Search instead for 
Did you mean: 

Two If statments

Former Member
0 Kudos

Hi Gurus,

Please check below conditon here two if statements are there

if a>b then Result = c - d

if c<=d then Result = 0

How to write if statement in Query designer

Regards,

Ram

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ram,

if a>b then Result = c - d

if c<=d then Result = 0

Use Boolean operation to achieve same.

(if ( (if a>b)*(c-d) ) > 0) gives value C - D if C > D.

Hope it Helps

Srini

Former Member
0 Kudos

Hi Srini,

Thanks for your reply,

I have written following condition., it is showing only boolean values in Result row 0's and 1's but it should show actual values.

(if ( (if a>b)*(c-d) ) > 0) gives value C - D if C > D.

Kindly advise,

Regards,

Ram

Former Member
0 Kudos

Ram,

You need to include : (Infoobject C - InfoObject D) as well, then you will get difference.

Small Correction, multiply with (C - D) as shown below.

(if ( (if a>b)*(c-d) ) > 0) * (c-d)

Hope it Helps

Srini

-

Former Member
0 Kudos

Hi Srini,

Thanks for your reply my problme is resolved, I will assign full points.

Thnaks

Ram

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Did u mean this?

If a>b then

if c<=d then

Result = 0.

else Result = c-d.

If it is so, then you can try the following:

(a>b)(((c-d)>0)(c-d))

Regards,

Anjana

Former Member
0 Kudos

Hi Anjana,

Thanks for reply

my condition is

Condition 1: if a>b then put Result = c - d

Condition 2: if c<=d then put Result = 0

Regards,

Ram,

former_member205352
Active Contributor
0 Kudos

(a>b)(c - d) + (c<=d)0

You need to even write the condition for

(a>b)(c - d) + (c<=d)0+ (a<=b)* ? + (c>d)*?

Hope this helps.

Former Member
0 Kudos

Hi Praveen,

Thanks for reply

I have written following statments but it is showing syntax error.

(a>b)(c - d) + (c<=d)0

You need to even write the condition for

(a>b)(c - d) + (c<=d)0+ (a<=b)* ? + (c>d)*?

Kindly advise,

Regards,

Ram.