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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dineshmdane
Partner - Contributor III
Partner - Contributor III

Count straight table rows

Hi All,

Kindly help me to count the number of rows in a straight table.

Example:

Straight_table.PNG

Note : '-' is Null in the above screenshot.

I have tried count(distinct Dimension) , I am getting 5.But the expected count is 3 excluding Nulls.

Thanks

Dinesh M

9 Replies
its_anandrjs
Champion III
Champion III

Try expression

count(distinct If(Dimension <> '-' or Dimension = isnull() or Dimension = 0,  Dimension) )

Kushal_Chawda

try below expression

=count(distinct {<Dimension={"=(Expression)>0"}>}Dimension)

its_anandrjs
Champion III
Champion III

Another version

=Count( Distinct {<Dimension -= {"=(Isnull(Dimension)) = -1"}>} Dimension )


Anonymous
Not applicable

Hi

Try this  SetAnalysis

=count(distinct {<Dimension={"=(Expression)>0"}>}Dimension)

It will Suppress your Null value OR Value with 0

Regards

Tahemas Momin

YoussefBelloum
Champion
Champion

Hi Dinesh,

Try this on the script :

if(expression <> '' or not isnull(expression),1,0) as count

Regards,

Youssef

its_anandrjs
Champion III
Champion III

Try some of this

=Count(distinct If(Expression <> '-' or Expression = Isnull() or Expression = 0,  Dimension) )


Or


=Count(distinct If( Isnull(Expression) <> -1,  Dimension) )

Or


=Count( Distinct {<Expression-= {"=(Isnull(Expression)) = -1"}>} Dimension )

sunny_talwar

What is your expression here?

Brice-SACCUCCI
Employee
Employee

Hello,

what about the following set analysis?

Count( DISTINCT {$<Dimension = {"=NullCount(Expression) > 0"}>} Dimension)

Regards,

Brice

its_anandrjs
Champion III
Champion III

I believe Expression is that you have some Metric calculation, if it is same than replace the Expression place with your expression.

Kindly check this also will it work for you.