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: 
kaustubh
Creator
Creator

Counting records in each bin from total records and then apply filters

I have a column say  "col_1" and has category's A, B, C

I need to count the total number of records in each field from total records and see their proportion in bar chart and then apply some filters.

Ex: A/(A+B+C) and so on for B and C.

 

pLEASE hELP

1 Solution

Accepted Solutions
kaustubh
Creator
Creator
Author

Here is something I tried that worked for me using the "Total" function from your answer.

Count(Col_1)/Count(Total Col_1)

 

This generated a proper bar graph on dashboard for each bin proportion from whole adding to 100.

 

Thanks bro.

View solution in original post

4 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Simple in expression use:
A: Count({<col_1 = {'A'}>}) / Count(Total col_1)
B: Count({<col_1 = {'B'}>}) / Count(Total col_1)
C: Count({<col_1 = {'C'}>}) / Count(Total col_1)

You should come up with total of 100%.
kaustubh
Creator
Creator
Author

Is it possible to perform in set analysis?
kaustubh
Creator
Creator
Author

I have ample of bins to write code as you said. I am looking for something like aggregation where I can group every category from A to Z and count the records in each category and then divide by total. Something kinda one line code in set analysis.

I do not wish to write a code line by line for each category !

kaustubh
Creator
Creator
Author

Here is something I tried that worked for me using the "Total" function from your answer.

Count(Col_1)/Count(Total Col_1)

 

This generated a proper bar graph on dashboard for each bin proportion from whole adding to 100.

 

Thanks bro.