6 Replies Latest reply: Nov 5, 2014 5:31 AM by youssef assenane

# conditions

hi,

how can i execute this condition in qlikview:

if(A>B){

print('toto')

}else{

print('titi'),

}else if(D>J){

print(toto1)

}else{

print(toto2)

}

• ###### Re: conditions

Hi,

I think this is the logic you're trying to script.

IF( (A>B), (IF(D>J) toto1, toto2), titi);

If A>B then you look whether D>J to define the type of toto to print, if the first condition does not apply, you print titi.

Regards,

• ###### Re: conditions

Try doing the test with the inverted logic:

if(A<=B,'titi',if(D>J,'toto1','toto2'))

• ###### Re: conditions

You have been asking on the Nested If,

Simple if:

If(condition, Expression for true, Expression for else)

If(condition, Expression for true, if(condition, Expression for true(else if part), Expression for false))

• ###### Re: conditions

if(A>B 'toto',

if(D>J 'toto1','oto2'),'titi')

• ###### Re: conditions

in the script and you want to write to the "console"?

IF A > B THEN
Trace 'toto';

ELSEIF B<A THEN

Trace 'titi';

ELSEIF D>J THEN
Trace 'toto1';

ELSE

Trace 'toto2';

ENDIF