Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

simple calculated dimention

Hi all,

i have two fields with code and Descption values..

I want to show  Descption dimentional value as "Others" where code = blank or null.

So i have written below  calculated dimention,but it will not give correct value.

=if(isnull(Code),'Others',Descption)

Code

=====

CAC
EDE
null or blank

Descption

========

AC Power Systems
DIGITAL ENERGY


  Any helpful suggestions
Thanks

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

=if(Len(Trim(Code))=0,'Others',Descption)

View solution in original post

5 Replies
ecolomer
Master II
Master II

It is possible is not null but is blank

Try with:

if(len(Code)<1, 'Others',Descption)

Not applicable
Author

Hi,

I would recommend making this change in the script, as that way your 'others' description is a real field value and can be selected.

If you must use a calculated dimension though, the below should work for you

Aggr(if(isnull(Code),'others',Description),Code)

hope that helps

Joe

anbu1984
Master III
Master III

=if(Len(Trim(Code))=0,'Others',Descption)

kamielrajaram
Creator III
Creator III

Hi,

Maybe this may help

if(Len(Code)<1,'Others',Description)

Regards

Kamiel

rajkumarb
Creator II
Creator II

Hi try this way


if(isnull(code), 'Null' others,  ) AS descption