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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Alessio
Contributor
Contributor

How to test if a field has value or is null (not linked)?

test.png

Hi,

I have this problem.

I have table A with field 'CodiceArticolo' and table B with fields 'CodiceArticolo' and 'Articolo'.

In a visualization of table type (see image), I have do check if 'Articolo' has no value. I tried to use IsNull function but I noticed that it works only if record in table B exists, while if a record linked to that CodiceArticolo doesn't exist in table B (and so I have no value for 'Articolo') IsNull function returns a kind of null value.

How can I do? Does other specific function exist?

Thanks

7 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Try IF(ISNULL(Articolo) OR LEN(Articolo) =0,'T','F')

Anil_Babu_Samineni

FIFO :  Try this?

IF(Len(Articolo)>0, 'F', 'T')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Alessio
Contributor
Contributor
Author

Thanks but it doesn't work... none of 2 suggestions

Anil_Babu_Samineni

Should work, For my case with sample it is working

Table1:
LOAD * Inline [
Name
A
B
C
D
];

Table2:
LOAD * Inline [
Name, Name1
A,
B, Sample
C, Sample1
D,
];

 

How is your data looks like?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

In the script use script below before table A & B

Map_NullValues:

MAPPING LOAD

NULL()                          AS [MapFrom],

'<Unknown>'           AS [MapTo]

AUTOGENERATE (0);

MAP * USING Map_NullValues;

Then in the UI you can then rewrite your expression IF(FieldName = '<Unknown>', 'T','F')

Alessio
Contributor
Contributor
Author

My data look like this:


Table1:
LOAD * Inline [
Name
A
B
C
D
];

Table2:
LOAD * Inline [
Name, Name1
A,
B, Sample
];
micheledenardi
Specialist II
Specialist II

 

MapValues:
Mapping
LOAD 
	Name,
	Name1
Inline [
Name, Name1
A,
B, Sample
];


Table1:
load
	Name,
	Name1,
	if(isnull(Name1) or trim(Name1)='','True','False') as Flag_IsNull;
LOAD 
	Name,
 	ApplyMap('MapValues',Name,null()) as Name1
Inline [
Name
A
B
C
D
];

 And the result is:

2018-12-10 11_51_26-QlikView x64 - Copia del rivenditore - [C__Users_denardm1_Downloads_test.qvw_].png

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.