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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sara_3
Creator II
Creator II

how to get count of a data

Hi,

I am creating the sample data table  here :

Code Category Key
112 A 001236
112 A 002589
112 A 002574
456 B 003698
456 B 007896
890 A 002365
890 A 005987
890 A 002365
342 B 001478

.i have 3 fields i want count of "key" of all code where "category" = A. I tried aggr function in expression but did not to get the expected answer. 

my input is Code. for example: when I select code (112 ) it belongs to category A . so my expected answer is count of all key which has category A. 

Expected result:      A =  count key = " 6 "

i have tried this expression but it gives me different answer.

Sum(Aggr(Count(Key),category)

Thanks!

Labels (1)
5 Replies
Mark_Winter
Creator
Creator

Hi Sara,

count({<category={'A'}>}key)

Sara_3
Creator II
Creator II
Author

Hi , sorry i forgot to mention that my input is Code. for example: when I select code (112 ) it belongs to category A . so my expected answer is count of all key which has category A. 

 

Sara_3
Creator II
Creator II
Author

i tried this expression but it gives me different answer.

Sum(Aggr(Count(Key),category)

Mark_Winter
Creator
Creator

Aggr({1}nodistinct Count(key),category)

Sara_3
Creator II
Creator II
Author

Thanks Mark , but does not work . it gave me total count of all key.