Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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
Highlighted
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.

Don't allow Perfection to be the enemy of Good Enough.
May you live in interesting times!
Highlighted
MVP
MVP

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

and

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

Highlighted
Specialist
Specialist

Try this,

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

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

Highlighted
Not applicable

Awsome....thank you!

Highlighted
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 .

Don't allow Perfection to be the enemy of Good Enough.
May you live in interesting times!
Highlighted
Specialist
Specialist

Hi Paul,

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

Regards,

Mahesh

Highlighted
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

Highlighted
Not applicable

Hi,

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

Thanks

Paul Featherstone

Highlighted
Anonymous
Not applicable

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