Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count If

Hi,

I'm am very new to Qlik and have built some great Apps simply bu dragging and dropping, I now want to be a little more specific.  I have a simple table called [Stud_Eng]:

Student_id    Eng

001               Y

002               Y

003               N

004               Y

005               Y

006               N

and so on.

I want an expression that will count the number of 'Y', if can count all Y and N and get 6, but I want the expression to return 4, i.e. the number of 'Y'.  I have tried

Count([Stud_Eng])='Y' and I get 0

Count([Stud_Eng]='Y') and I get 6

I know it's simple, but it would really help.

Thanks

1 Solution

Accepted Solutions
tyagishaila
Specialist
Specialist

Count Student_id where Eng is Y

COUNT({<Eng={'Y'}>}Student_id)


Count no of Y in Eng field


Count( {<Eng={'Y'}>} Eng)


View solution in original post

9 Replies
oknotsen
Master III
Master III

Since you are talking about "Dragging and dropping", I have to double check: Is this a QlikView or a Qlik Sense app you are working on?

In both situations, the solution probably would be the same:

= count({ < Eng = { 'Y' } > } Student_id)

Though you can probably solve it easier by making a table with "Eng" as Dimension and "count(Student_id)" as expression.

May you live in interesting times!
MK_QSL
MVP
MVP

COUNT({<Eng = {'Y'}>}Distinct Student_id)

and

COUNT({<Eng = {'N'}>}Distinct Student_id)

qlikview979
Specialist
Specialist

Try this,

COUNT(DISTINCT{<Eng={'Y'}>}Student_id)

COUNT(DISTINCT{<Eng={'N'}>}Student_id)

Not applicable
Author

Awsome....thank you!

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).

If not, please make clear what part of this topic you still need help with .

May you live in interesting times!
qlikview979
Specialist
Specialist

Hi Paul,

Please mark the "Correct Answer"  and close this thread it will helpful to  some people.

Regards,

Mahesh

tyagishaila
Specialist
Specialist

Count Student_id where Eng is Y

COUNT({<Eng={'Y'}>}Student_id)


Count no of Y in Eng field


Count( {<Eng={'Y'}>} Eng)


Not applicable
Author

Hi,

I have marked the answer as helpful, but how do I close the thread….?

Thanks

Paul Featherstone

Anonymous
Not applicable
Author

Hi Paul,

Marking a reply as the Correct Answer changes the thread status to Answered. For all intents and purposes, that "closes" the thread.

Best regards,

Qlik Community Team