Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for
Did you mean:
Not applicable

## How to calculate total count of a specific value in a field?

Hi All,

I am trying to calculate the count of a specific value in a field. I would like a table with 'Topic,' and when i pick a specific topic I am able to get a total count from a Yes/No field 'Validation.'  For example: Topic = documents and the validation has 24 docments have YES and 6 NO.  How can I get it to show the total YES/NO count based on criteria I pick?  I currently have my Dimension = Topic, Expression = count(distinct(validation).

1 Solution

Accepted Solutions
Not applicable
Author

Looks like my image didn't come across. Here you go:

8 Replies
Partner - Champion III

Hi

You will need something like

Count({<Validation = {'yes'}>} Validation}

or

Sum({<Validation = {'yes'}>} 1}

Hope the helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Partner - Champion III

Remember that QV field names are case-sensitive - validation <> Validation

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

That does work, thank you.  How can I take it one step further so that when I pick a topic, say "Large reports," it will show me that out of 20 Topics, there are 10 large reports and 'x' are yes and 'x' are No validations?

Not applicable
Author

I would suggest building a Straight Table Chart with your 'Validation' field as the Dimension and Count(Validation) as the expression. This will look something like this:

Not applicable
Author

Looks like my image didn't come across. Here you go:

Not applicable
Author

Thank you for your response. I have done the validation table, but when I click on a specific Topic, the table does not change.  It continues to show the total of the count of all validations.  I though it would adjust as you dive deeper into specifics.

Not applicable
Author

Hey, I figured out the problem.  The key field in which i was connecting too was somehow not allowing it to link correctly. The the working formula was Count({<Validation = {'yes'}>} Validation}. Thanks Jonathan and  Rebeccad.

Creator II

how can I do this in a pie chart?

Community Browser