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: 
Tarig
Contributor III
Contributor III

How to count in Dimension

Hello 

I have a table and I am trying to count the distinct memberId in dimension if the earnings field is > 0, so I put together this expression, but giving me an error (Invalid dimension). My expression is :  Count({<Earnings = {">0"}>} DISTINCT MemberId )

2 Solutions

Accepted Solutions
Tarig
Contributor III
Contributor III
Author

Thank you Kushal, This worked just fine. 

View solution in original post

Kushal_Chawda

@Tarig  please accept the reply as solution 

View solution in original post

6 Replies
Taoufiq_Zarra

@Tarig  use measure instead of dimension

can you share a sample data and the expected output

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Tarig
Contributor III
Contributor III
Author

Thank you for the quick respond. Measure works find but I need to use dimension so it can be clickable. look at the table I posted. 5870 represent the the distinct memberId when I use this expression Count({<Earnings = {">0"}>} DISTINCT MemberId ) as a measure.  but again I need to use it as dimension  so end user can click on it and whose these member are. Thanks alot.

Tarig
Contributor III
Contributor III
Author

 
Kushal_Chawda

@Tarig  try below in dimension

=aggr( Count({<Earnings = {">0"}>} DISTINCT MemberId ), Dimension1,Dimension2)

where dimension 1 & dimension2 are dimensions of your chart.. include all the dimensions in aggr

Tarig
Contributor III
Contributor III
Author

Thank you Kushal, This worked just fine. 

Kushal_Chawda

@Tarig  please accept the reply as solution