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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ValeriaBonini
Partner - Creator
Partner - Creator

Counting null values for each field

Hi, I'm creating a table to monitorate all my tables.

I would like also to know the nuber of null values for each field in each table, is it possible?

I tried with nullCount($Fields) but Id doesn't work. 

 

 

ValeriaBonini_1-1739542359255.png

 

Labels (5)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It gets a bit tricky to do this in a generic way without hardcoding the fieldname. The expression I've found that works is:

pick(
FieldIndex('$Field', only({1<$Table=P($Table), $Field=P($Field)>}[$Field]))
, $(=concat({1} DISTINCT 'NullCount({1} TOTAL [' & [$Field] & '])', ',', FieldIndex('$Field', [$Field])))
)

See https://qlikviewcookbook.com/2020/06/data-browser-tricks/ for more including a download link for a sample qvf..

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

6 Replies
Arek92
Contributor III
Contributor III

Hi, have you tried with sth like this as your formula?

Sum(If(IsNull($Field), 1, 0))

Chanty4u
MVP
MVP

Try this 

Count({<YourField = {"=IsNull(YourField)"}>} YourField)

Or

Count({<YourField = {"=Len(Trim(YourField))=0"}>} YourField)

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It gets a bit tricky to do this in a generic way without hardcoding the fieldname. The expression I've found that works is:

pick(
FieldIndex('$Field', only({1<$Table=P($Table), $Field=P($Field)>}[$Field]))
, $(=concat({1} DISTINCT 'NullCount({1} TOTAL [' & [$Field] & '])', ',', FieldIndex('$Field', [$Field])))
)

See https://qlikviewcookbook.com/2020/06/data-browser-tricks/ for more including a download link for a sample qvf..

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

vBonini
Contributor II
Contributor II

Hi, is there any way to use this formula also for a table like this to show the total number of null values for each table? 

In your link I also saw that the user has a table in wich is shown the datatype for each field, how is it possible?

vBonini_0-1739787414550.png

 

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @vBonini I suggest you download the sample QVF and investigate the expressions. 

-Rob

vBonini
Contributor II
Contributor II

Hi, I didn't found how to insert the total number of null values (in all $Table) in a single kpi.

could you help me?