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

How to select NULL values in Table Chart

Hi All -

Need to select "Null" values in chart, these null values generated while connecting/relation between tables.

"NullAsValue" will useful while dealing with nulls in single load/table however my scenario is different. Is there any possibility ?

For instance: Have to select below highlighted records and see related information. Please consider this one as sample scenario.

nihhalmca_0-1672775983611.png

Source:

nihhalmca_1-1672776140341.png

 

Thank you.

 

Labels (1)
  • Chart

7 Replies
BrunPierre
Partner - Master
Partner - Master

How about this?

Tab1:
Mapping LOAD * Inline [
ID, Product
1, A
4, B
];

Tab2:
LOAD *,
ApplyMap('Tab1',ID,'<NULL VALUE>') as Product
Inline [
ID, Sales
1, 100
2, 200
3, 300
4, 400
];

EXIT SCRIPT;

BrunPierre_0-1672778452682.png

nihhalmca
Specialist II
Specialist II
Author

Thanks for response. Actually my requirement is different. They are null values while having relation between multiple tables. I shared source for sample. There are  multiple table and fields has null values.

marcus_sommer

NULL means the absence of any value and isn't stored anywhere and couldn't be accessed or selected - regardless if the NULL occurred directly within a table or if it's the result of an association. The only way to access/select NULL is to replace them with real values. The suggestion from @BrunPierre demonstrate an easy and very common way to handle such a scenario - and yes it means also that you need data(-quality) checks during the app-development and appropriate measures to adjust the data-model.

Usually it's neither needed nor sensible to replace all NULL's in all fields and all possible associations - else it may helpful by a few cases and therefore the extra efforts to handle them aren't really expensive ...

Or
MVP
MVP

One other potential workaround for cases where this is specifically required is to use a calculated dimension, e.g.

Coalesce(Product,'-')

Which would make this dimension available for selection based on the context of the table, without modifying the underlying value of Product for the entire app.

SerhanKaraer
Creator III
Creator III

Hello nihhalmca,

If you want to filter records in the chart, you have to add flag fields in the script as below:

Tab1:
LOAD *, 1 as flag1 INLINE [
ID, Product
1, A
4, B
];

Tab2:
LOAD *, 1 as flag2 INLINE [
ID, Sales
1, 100
2, 200
3, 300
4, 400
];

 Then you can filter in the chart by appying filter in ID field as below:

=only({<flag2={1}>-<flag1={1}>} ID)

I hope it resolves you issue.

vikasmahajan

Hi,

While loading data you can check nulls see below post

https://data-flair.training/blogs/qlik-sense-null-functions/

If(len(trim(Product))= 0 or Value='NULL' or Value='-', Null(), Value ) as Prod_Null;

use this flags in set analysis to avoid null values

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
sidhiq91
Specialist II
Specialist II

@nihhalmca  Please see the code used below:

NoConcatenate
Temp:
Load * inline [
ID, Product
1,A
2,B
];

Outer join (Temp)
Temp2:
Load * Inline [
ID, Sales
1, 100
2, 200
3, 300
4, 400
];

NoConcatenate
Temp3:
Load ID,
if(isnull(Product),'NULL',Product) as Product,
Sales
Resident Temp;

Drop table Temp;

Exit Script;

If this resolves your issue please like and accept it as a solution