Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

rominavilla
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
Not applicable

Re: If nested three conditions

Try this

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

6 Replies
dagomezl
Not applicable

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'

     )

)

Sokkorn
Not applicable

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(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

rominavilla
Not applicable

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.

er_mohit
Not applicable

Re: If nested three conditions

Try this

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

Gysbert_Wassenaar
Not applicable

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


talk is cheap, supply exceeds demand
rominavilla
Not applicable

Re: If nested three conditions

That works!

Thank you.

Regards.