Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

okolyug16
Contributor II

Display value for null

Hi all,

Is it possible to display N for null values in a dimension?

I have a field(List) with Y and null values, on the front end I'd like to display the null values as N in a straight table, the expression if(IsNull(List),'N',List) works correctly when used as a measure however I need the column to be a dimension to allow users select values.

Any thoughts?

Capture.PNG

Thanks

Tags (3)
7 Replies

Re: Display value for null

May be this:

If(Len(Trim(List)) = 0, 'N', List)

okolyug16
Contributor II

Re: Display value for null

Thanks Sunny, I tried your suggestion and the null still displays as null

rohitk1609
Valued Contributor II

Re: Display value for null

Hi Ugonna,

I am attaching a sample application for you , this will solve your purpose.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Rohit Kumar



nikhilpotdar
New Contributor

Re: Display value for null

Hi Ugonna,

Please add Calculated Dimension in your Dimension.

=If(len(Dimension)=0,'Null',Dimension)

Example:

=If(len(List)=0,'Null',List)

Table:

Solution2.jpg

okolyug16
Contributor II

Re: Display value for null

Hi Rohit,

I'm trying to implement your solution but it doesn't work with my data model, here's a bit more detail on what my data looks like;

table 1

ID , Name

A, Apple

B, Banana

C, Car

D, Doll

E, Egg

table 2

ID , List

A, Y

D, Y

Now, I need to create a table with fields Name and List, displaying N when List is null.

thank!

okolyug16
Contributor II

Re: Display value for null

Hi Nikhil, thanks for your suggestion.

It appears these expressions only work in QS when used as a measure, and I need the field to be a dimension to allow for user selections.

rohitk1609
Valued Contributor II

Re: Display value for null

Hi Nikhil,

Please create a new application and go to script editor and paste the below code :

table1:

load

*

inline

[

ID , Name

A, Apple

B, Banana

C, Car

D, Doll

E, Egg

];

table2:

load

ID,

If(Len(Trim(List)) = 0, 'N', List) as List

inline

[

ID , List

A, Y

D, Y

C ,

];

Now go to app overview and select drag and drop two column , ID and List and let me know if still you need anything

Community Browser