# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
cancel
Showing results for
Did you mean:  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_trans Risk_trans_bucket Risk_trans FC Med -7 GMO Low 10 Logging Low 0 Def High -12 FC Low 3 GMO Low -5 Logging Med -6 Def Med -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)

• ### count rows

1 Solution

Accepted Solutions  MVP

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)``
4 Replies  MVP

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)``  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!  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?  MVP

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