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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Jul_Eng_
Contributor
Contributor

Problem with Count if

Hello everyone,

I have two pivot tables in my worksheet. The first table contains the orders of a week for a machine. One column contains 'yes' or 'no':

Order-No.          yes or no?

1                                 no

2                                 no

3                                yes

4                                 no

5                                yes

6                               yes

7                                 no

 

In the second pivot table contains all machines. I want to count the number of orders and the number of 'yes' items. I already have the total number of orders but I have problems with the "yes-items"

Orders total            yes-items

     7                                    3

Can you help me with the correct expression? I tried a lot with count (if()).

 

Thanks!

 

 

1 Solution

Accepted Solutions
JuanGerardo
Partner - Specialist
Partner - Specialist

That expression counts distinct OrderNums. Maybe you are looking for:

Count({<yes-items={'yes'}>} yes-items)

JG

View solution in original post

4 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @Jul_Eng_, you can try with set analysis:

Count({<yes-items={'yes'}>} Distinct OrderNum)

JG

Jul_Eng_
Contributor
Contributor
Author

Thanks @JuanGerardo, I tried this, but as result I get 7 yes-items instead of 3 yes-items 🤔

JuanGerardo
Partner - Specialist
Partner - Specialist

That expression counts distinct OrderNums. Maybe you are looking for:

Count({<yes-items={'yes'}>} yes-items)

JG

Jul_Eng_
Contributor
Contributor
Author

Thank you! 😊