Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Counting text objects

Hi again,

Another question for you. I want to count a set of post where one of the variables is a text entry. I have a few different statuses; "Draft", "Approved" and "Evaluation" and in an chart expression I am trying to do something like this:

COUNT(DISTINCT IF(status<>"Approved",name))

What this is to result in is a number of the post where the status is "Approved". Seems easy enough, but I cant get it to work. Thoughts?

Cheers,

1 Solution

Accepted Solutions
swuehl
MVP
MVP

COUNT(DISTINCT IF(status<>"Approved",name))

What this is to result in is a number of the post where the status is "Approved". Seems easy enough, but I cant get it to work. Thoughts?

Do you want to get the result for status is equal 'Approved' or is not equal 'Approved'? Your expression is calling for is not.

If you want to check for equal, then use either


=COUNT(DISTINCT IF(status = 'Approved',name))


{note also the single quotes}


or

=COUNT({<status = {Approved}>} distinct name)

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try count({<status-={'Approved'}>} distinct name). Make sure to use the exact case-sensitive field names and values. If you need more help, please post a sample document that demonstrates the problem.


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

COUNT(DISTINCT IF(status<>"Approved",name))

What this is to result in is a number of the post where the status is "Approved". Seems easy enough, but I cant get it to work. Thoughts?

Do you want to get the result for status is equal 'Approved' or is not equal 'Approved'? Your expression is calling for is not.

If you want to check for equal, then use either


=COUNT(DISTINCT IF(status = 'Approved',name))


{note also the single quotes}


or

=COUNT({<status = {Approved}>} distinct name)

Not applicable
Author

excellent! thank you!

naturally i meant "=" and not "<>", that was just a brain crash on my end, good that you caught that . i think my biggest problem with this was mainly that i was using a " when i should have been using '. you live and learn i guess ...