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: 
Not applicable

Count for specific values

I have the following table

department       Overall Satisfaction

---------------       ------------------------------

Inpatient            Extremely Satisfied

Inpatient            Satisfied

Outpatient         dissatisfied

Inpatient           dissatisfied

Outpatient         Satisfied

I want to get the following formula ( Extremely satisfied + Satisfied) of inpatient / Count( department = 'Inpatient)   

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

count({<[Overall Satisfaction']={'Extremely Satisfied','Satisfied'},department={'Inpatient'}>} department) / count({<department={'Inpatient'}>}department)

or maybe you want to count Satisfied or Extremely Satisfied for both departments and then divide by the count of department Inpatient:

count({<[Overall Satisfaction']={'Extremely Satisfied','Satisfied'>} department) / count({<department={'Inpatient'}>}department)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

count({<[Overall Satisfaction']={'Extremely Satisfied','Satisfied'},department={'Inpatient'}>} department) / count({<department={'Inpatient'}>}department)

or maybe you want to count Satisfied or Extremely Satisfied for both departments and then divide by the count of department Inpatient:

count({<[Overall Satisfaction']={'Extremely Satisfied','Satisfied'>} department) / count({<department={'Inpatient'}>}department)


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks dude your a life saver