Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

1 Solution

Accepted Solutions
er_mohit
Master II
Master II

Try this

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

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hello,

if(

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

     'Z',

     if(

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

          'Y'

     )

)

Sokkorn
Master
Master

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(isnull(a) and isnull(b) and (not isnull(c), 'Z',

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

Anonymous
Not applicable
Author

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.

er_mohit
Master II
Master II

Try this

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

Gysbert_Wassenaar

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...;


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

That works!

Thank you.

Regards.