Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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

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

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

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

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.