<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Show Non Null Values by Field in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Show-Non-Null-Values-by-Field/m-p/1814276#M66568</link>
    <description>&lt;P&gt;You could try to do the essentially checks already within the initial (preceeding) load and/or using an appropriate parallel load with something like this for each field:&lt;/P&gt;&lt;P&gt;rangesum(-(len(Field1)&amp;gt;=1), peek('Field1Check')) as Field1Check&lt;/P&gt;&lt;P&gt;which cumulates a NULL check over all records. Afterwards you could within a loop query with peek() the last record from each field to get the number of non NULL values and the difference between this value and noofrows() will be the NULL's.&lt;/P&gt;&lt;P&gt;I doubt that this will be really fast but it should be significantly better performing as the mentioned aggregation-loads.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jun 2021 16:40:52 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2021-06-10T16:40:52Z</dc:date>
    <item>
      <title>Show Non Null Values by Field</title>
      <link>https://community.qlik.com/t5/App-Development/Show-Non-Null-Values-by-Field/m-p/1814239#M66561</link>
      <description>&lt;P&gt;Hello Qlik Community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with a large database table &amp;gt; 100 fields and I have a need to know for each field the number of values that are null and the number of values that are not null.&amp;nbsp; I tried creating the below loop using FieldValueCount and NoOfRows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LIB CONNECT TO 'My Database';

My_Table:
LOAD
*;
SQL Select * from mydatabasetable;

Let vNoOfFields = NoOfFields('My_Table'); 


For i = 1 to $(vNoOfFields) step 1

Load
FieldName('$(i)','My_Table') as FieldName,
FieldValueCount(FieldName('$(i)','My_Table')) as NonNullCount,
NoOfRows('My_Table') - FieldValueCount(FieldName('$(i)','My_Table')) as NullCount,
NoOfRows('My_Table') as TotalRowCount
AutoGenerate 1;

Next 

Drop Table My_Table;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is working with the issue that my NonNullCount is not really a NonNullCount but rather a distinct value count because FieldValueCount() returns distinct FieldValueCount.&amp;nbsp; I was wondering if anyone has any ideas on how I could return just total FieldValueCount() instead of distinct FieldValueCount.&amp;nbsp; I figure it has to be possible because Qlik displays this information in the Field Preview section of the data model viewer so this information has to be accessible somehow!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-06-10 10_30_46-Totals - My new sheet (5) _ Sheets - Qlik Sense.png" style="width: 259px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/56606iCCF0ADD1AF745CCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-06-10 10_30_46-Totals - My new sheet (5) _ Sheets - Qlik Sense.png" alt="2021-06-10 10_30_46-Totals - My new sheet (5) _ Sheets - Qlik Sense.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know I could use a resident and Count() and NullCount() instead of an Autogenerate but this would cause my loop to take hours because of the many fields and many rows.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hoping someone might have some thoughts!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Mark&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 14:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-Non-Null-Values-by-Field/m-p/1814239#M66561</guid>
      <dc:creator>mjperreault</dc:creator>
      <dc:date>2021-06-10T14:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Show Non Null Values by Field</title>
      <link>https://community.qlik.com/t5/App-Development/Show-Non-Null-Values-by-Field/m-p/1814276#M66568</link>
      <description>&lt;P&gt;You could try to do the essentially checks already within the initial (preceeding) load and/or using an appropriate parallel load with something like this for each field:&lt;/P&gt;&lt;P&gt;rangesum(-(len(Field1)&amp;gt;=1), peek('Field1Check')) as Field1Check&lt;/P&gt;&lt;P&gt;which cumulates a NULL check over all records. Afterwards you could within a loop query with peek() the last record from each field to get the number of non NULL values and the difference between this value and noofrows() will be the NULL's.&lt;/P&gt;&lt;P&gt;I doubt that this will be really fast but it should be significantly better performing as the mentioned aggregation-loads.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 16:40:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-Non-Null-Values-by-Field/m-p/1814276#M66568</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-06-10T16:40:52Z</dc:date>
    </item>
  </channel>
</rss>

