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: 
abhi1693r
Contributor II
Contributor II

Counting rows in data

Hi,

I have A-E, 5 columns/variables in my data.

Lets say A has 3 options MD,SD and RT.

I have created a multibox to sort with SD and count the entries.

 

Can I do the same with a text box containing formula? such as

=(Count( DISTINCT {<A={"SD"}>} A))

5 Replies
lockematthewp
Creator II
Creator II

yes that would provide you with the number of distinct values in A. You can also display them by having a text box with =concat(distinct {<[A]={'SD'}>} [A], ',') 

abhi1693r
Contributor II
Contributor II
Author

I wanted to count instead of concat, what should I do?

lockematthewp
Creator II
Creator II

Your original expression will return the count.

=(Count( DISTINCT {<A={"SD"}>} A))

abhi1693r
Contributor II
Contributor II
Author

I was trying something like 

=(Count( DISTINCT {<A={"SD"}>}{<B={"TD"}>} A))

And I noticed that only A=SD condition is applying but B=TD is NOT.

Is there a way to implement both conditions together with 'OR' logical operator??

lockematthewp
Creator II
Creator II

+ is used for or in set analysis.

=(Count( DISTINCT {<A={"SD"}>}+{<B={"TD"}>} A))