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: 
rcorcoran
Creator
Creator

how do you count a field that is empty

Hi

I want to count the order_id  where the comment field is empty.  (in a straight table)

if anyone could help it would be great

9 Replies
tresesco
MVP
MVP

Try like :

=Count ( Distinct If( Len(Trim(comment))=0, order_id))

israrkhan
Specialist II
Specialist II

Hi,

Try like this..

Count({<comment={' '}>} order_id)

rbecher
MVP
MVP

This should work:

=Count(DISTINCT order_id) - Count({<comment={"*"}>} DISTINCT order_id)

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
rcorcoran
Creator
Creator
Author

Thanks for your replies.  I still can't get it to work.  I probably didnt explain properly:

the expression I have is:

 

count({$<[KPI within 1] = {'1'}>} distinct order)  I now need to have the same expression but only count the comment fileds that are blank or have ' - ' in them?

Thanks

ljackson
Creator
Creator

Have you tried the ISNULL function?

Yousef_Amarneh
Partner - Creator III
Partner - Creator III

If(isnull(Comment),count(order_id),0)

Yousef Amarneh
VishalWaghole
Specialist II
Specialist II

Hi rhona,

Try this on script level

Load Order_id,

        if(isNull(Order_id),'NULL','NOT_NULL') as ORDER_ID_NULL_FLAG

from  table_name;

then count NULL values on expression level,

=count(<ORDER_ID_NULL_FLAG = {<'NULL'>}> Order_Id)

This will return you the count of only Null Order Id

Thanks and Regards,

Vishal Waghole

MayilVahanan

HI

Try like this

count({$<[KPI within 1] = {'1'}, comment -={'*'}>} distinct order)



Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable

Try load with:

LOAD *,if(comment ='','-',comment) as comment1

from TABLE_NAME;

And then use following expression in chart:

count({$<[KPI within 1] = {'1'}, comment1 = {'-'}>} distinct order)

Hope it helps...