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

Null and data completeness percentage

Hi Everyone , 

I have two tables Table A and Table B , my requirement is I have to calculate How many null values Table A and Table B  have and Data completeness percentage for both the tables .

below is my tables,

Table A   Table B  
nameaddressphone salarycontactpin
Anull789 nullnull123456
bnullnull nullnull456
cBGnull 78909null789

 

expected output

Tablesnullcompleteness
Table A455%
Table B544%

Below is my expression :

Null :
if($Table='Table A', sum(if(IsNull(name),1,0))+sum(if(IsNull(Address),1,0))+sum(if(IsNull(phone),1,0)))

completeness:
if($Table='Table A', (1-sum(if(IsNull(name),1,0))+sum(if(IsNull(Address),1,0))+sum(if(IsNull(phone),1,0)) /
sum(if(not IsNull(name),1,0))+sum(if(not IsNull(Address),1,0))+sum(if(not IsNull(phone),1,0))))*100

 

I got null values correctly , please help me to get completeness by percentage.. 

 

Thanks,

Krish.

Labels (2)
4 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi

try with

1- (your null expression ($Rows*Max($FieldNo)))

deepakkrish
Creator
Creator
Author

Thanks for your reply .. this is not working

asinha1991
Creator III
Creator III

there might be a better way but you can do this

 

(count(name)+count(Address)+count(phone))/NoOfRows('TableA')*3

 

3 is number of fields which you already know..

 

also for counting null there is a direct function NullCount(FieldName) you don't need to use sum with if

Brett_Bleess
Former Employee
Former Employee

Krish, did the last post help you get things working?  If so, do not forget to use the Accept as Solution button on the post to give credit for the help and let others know that worked.  If you are still needing help, leave an update for us.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.