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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excluding nulls, blanks and empty fields in counting rows

I am trying to exclude Null, blanks and empty fields from count but without success. I would like to count rows which has its field 'Description' different from null, blank or empty, so I perform:

=Count({$<[Type] = {'A'}, $(=Len($(=Trim(Description))))={'>0'}>} [Description])

but it is not working. Doing:

=Count({$<[Type] = {'A'}>} [Description]) does not work. It includes empties and blanks.


Also I have tried using Sum function with the same set analysis but without success.


for example, from below table:


Order     Type     Description

0001     A            Order type A

0002     B           Order type B

0003     A          

0004     A            Order type A


The result should be 2. Order 0002 is not counted because is of type B and order 0003 is not counted because its description is empty (blank).



11 Replies
sunny_talwar

You can try this:

Count({$<[Type] = {'A'}, Description = {"=Len(Trim(Description)) > 0 and Description <> 'Null' "}>} [Description])

jeevays7
Partner - Creator III
Partner - Creator III

Hi Tony,

Here,

[Type] = {'A'}, $(=Trim(Description))-={'','Null'}


you cant able to use function in modifier before "=" like this -> $(=Trim(Description))={}.

only use filed names like [Type]=.

then

try this.

Count({$<[Type] = {'A'}, Description-={"$(=Trim(Description)=''))",'Null'}>} [Description])


or


Try Sunny expressions in last.