6 Replies Latest reply: Jun 12, 2013 8:51 AM by Romina Villa

If nested three conditions

Hi,

I need create a dimension based on three conditions, I mean:

if(isnull(a) and isnull(b) and (not isnull(c), 'Z',

if((not isnull(a) and isnull(b) and isnull(c), 'Y')) as Dimension

This for seven cases. Always the same three fields in the conditions, always if is null or not null.

That code doesn't work in the script in Qlikview, neither:

if(isnull(a),

if(isnull(b),

if((not isnull(c)),'Z',

)

How I do that dimension in Qlikview?

Thanks. Regards.

• Re: If nested three conditions

Hello,

if(

isnull(a) and isnull(b) and not isnull(c),

'Z',

if(

not isnull(a) and isnull(b) and isnull(c),

'Y'

)

)

• Re: If nested three conditions

Hi Romina,

I think there are some issue with your If statement

Romina Villa wrote:

Hi,

I need create a dimension based on three conditions, I mean:

if((not isnull(a) and isnull(b) and isnull(c), 'Y')) as Dimension

So can you try below one and let me know:

If(IsNull(a) and IsNull(b) and Not IsNull(c),'Z',

If(Not IsNull(a) and IsNull(b) and IsNull(c),'Y')) as Dimension;

....

Regards,

Sokkorn

• Re: If nested three conditions

Hi,

That solutions doesn't work for me.

I've tried that what you say, Sokkorn, but that returns only the last value that I inserted in the code.

That's why I tried later with the parenthesis before nulls.

Thanks.

• Re: If nested three conditions

Try this

if(match(a,'0') and match(b,'0') and match(c,'0'), 'Z','Y')

• Re: If nested three conditions

That works!

Thank you.

Regards.

• Re: If nested three conditions

Try:

IsNullMap:

mapping load * inline [

ABC, Letter

000,S

001,P

010,Q

011,Y

100,R

101,X

110,Z

111,T

];

Load A,B,C, applymap('IsNullMap', -isnull(A)&-isnull(B)&-isnull(C)) as Dimension

from ...somewhere...;