Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

case when not 'attr1' is null implementation in script

How to implement the below in qlickview script

i.e is not null concept in qlik view script

case  when not  ATTR1 is null then ATTR1

when not ATTR2 is null then ATTR2

when not ATTR3 is null then ATTR3

else 'N/A' end  "Hold_Reasons"

1 Solution

Accepted Solutions
sivarajs
Specialist II
Specialist II

if(not isnull(ATTR1 ),ATTR1 ,

if(not isnull(ATTR2 ),ATTR2,

if(not isnull(ATTR3 ),ATTR3,'N/A')))

or

if(isnull(ATTR1 )<>-1,ATTR1 ,

if(isnull(ATTR2 )<>-1,ATTR2,

if(isnull(ATTR3 )<>-1,ATTR3,'N/A')))

View solution in original post

4 Replies
sivarajs
Specialist II
Specialist II

if(not isnull(ATTR1 ),ATTR1 ,

if(not isnull(ATTR2 ),ATTR2,

if(not isnull(ATTR3 ),ATTR3,'N/A')))

or

if(isnull(ATTR1 )<>-1,ATTR1 ,

if(isnull(ATTR2 )<>-1,ATTR2,

if(isnull(ATTR3 )<>-1,ATTR3,'N/A')))

Not applicable
Author

It's working thank you

Anonymous
Not applicable
Author

I use this syntax :

IF(LEN(TRIM(ATTR1))=0,ATTR1,
IF(LEN(TRIM(ATTR2))=0,ATTR2,
IF(LEN(TRIM(ATTR3))=0,ATTR3,'N/A'))) AS Hold_Reasons

This will work for blank spaces and null values.

I hope this helps!

Regards

MultiView

rlp
Creator
Creator

You should replace '=' by '<>'. Otherwise, you obtain only NULL values..

You should even write:

if( Len(Trim(_)) , ATTR? , ... )