Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sbwales
Contributor II
Contributor II

Count of rows with specific categorical value

Hello,

I have two related questions. First, can someone help me write an expression that counts the number of instances of a row with a specific nominal value? 

My data structure looks like this: 

Criteria_transRisk_trans_bucketRisk_trans
FCMed-7
GMOLow10
LoggingLow0
DefHigh-12
FCLow3
GMOLow-5
LoggingMed-6
DefMed-9

 

I would like to know the count of each of the 'Risk_trans_bucket' levels for all of my data. More specifically, I would like to create a KPI for Low, Med and High respectively. The solution for this example would be:

Low = 4

Med = 3

High = 1

 

The next question I might want to ask is, how many 'Low's are associated with 'FC' in the 'Criteria_Risk' column. 

The count of 'Low's for the example would be:

FC = 1

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

1st Req

Create a chart with Risk_trans_bucket as dimension and Count(Criteria_trans) as expression.

2nd Req

Count({<Criteria_trans = {'FC'}, Risk_trans_bucket = {'Low'}>}Criteria_trans)

View solution in original post

4 Replies
sunny_talwar

1st Req

Create a chart with Risk_trans_bucket as dimension and Count(Criteria_trans) as expression.

2nd Req

Count({<Criteria_trans = {'FC'}, Risk_trans_bucket = {'Low'}>}Criteria_trans)
sbwales
Contributor II
Contributor II
Author

For Req 1 I wanted to create 3 different KPIs so I converted your answer from Req 2 and used it to solve Req 1: 

Count({<Risk_trans_bucket = {'Low'}>}Risk_trans_bucket)

Count({<Risk_trans_bucket = {'Med'}>}Risk_trans_bucket)

Count({<Risk_trans_bucket = {'High'}>}Risk_trans_bucket)

 

Thanks!

sbwales
Contributor II
Contributor II
Author

This is actually not working for me.. It is just giving me a total count of all the FC rows but not by Low/Med/High. Any ideas?

sunny_talwar

Would you be able to share a sample to show the issue?