Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
JackR
Contributor II
Contributor II

Question about Count function

Hi Folks,

New here, this is my first post, any help is welcome.

I want to count all records based on the values in two columns. (result in KPI).
The first column is the column “Hoofddieetcode”, the values there has to be 111 or 2911. I use this and that works fine:

Count({<[Hoofddieetcode]={111,2911}>}Hoofddieetcode)

But now i want to count these and then only those with specific value in another columns.

The result has to be only with 111 or 2911 in “hoofddieetcode” minus those that have Tussendoor in column “naam productiestroom” and also 111 or 2911 in “hoofddieetcode”

The challenge i guess is how to nest these commands, in Excel i filter both columns for the result.

Thanks in advance,

3 Solutions

Accepted Solutions
stevejoyce
Specialist II
Specialist II

Hi @JackR ,

This wlil exclude Tussendoor records:

 

Count({<[Hoofddieetcode]={111,2911}, [Naam productiestroom] -= {'Tussendoor'}>} Hoofddieetcode)

View solution in original post

stevejoyce
Specialist II
Specialist II

in my original post i used -= this is not equal.  so you can use the same for #3.

Count({<Hoofddieetcode -= {111,2911,112,113,114,115,116,2912,2913,2914,2915,2916} >} Hoofddieetcode)

View solution in original post

JackR
Contributor II
Contributor II
Author

many thanks to Stevejoyce, this results is wished outcome, the count-function for group 3 is:

Count({<[Hoofddieetcode]-= {111,2911,112,113,114,115,116,2912,2913,2914,2915,2916}, [Naam productiestroom] -= {'Tussendoor'}>} Hoofddieetcode)

View solution in original post

5 Replies
stevejoyce
Specialist II
Specialist II

Hi @JackR ,

This wlil exclude Tussendoor records:

 

Count({<[Hoofddieetcode]={111,2911}, [Naam productiestroom] -= {'Tussendoor'}>} Hoofddieetcode)

JackR
Contributor II
Contributor II
Author

Thanx Stevejoyce, this works indeed, great! 👍

JackR
Contributor II
Contributor II
Author

The solution from Stevejoyce works fine but it gives me another issue, the sample is just an extraction, i have about 100 different codes in "Hoofddieetcode". i have 3 groups for them:
1. group of 2 items: 111 en 2911
2. group of 10 items (112,113,114,115,116,2912,2913,2914,2915,2916)
3. group with all the others

The solution Stevejoyce provided seems to work fine for 1 and 2, but for 3 i use now:

Count(total Hoofddieetcode)-(Count({<Hoofddieetcode={111,2911,112,113,114,115,116,2912,2913,2914,2915,2916}/* MISSING VALUES */>} Hoofddieetcode))

I don't get the sulution into this function, i suppose there is a better way then copy the first or third and make a total  list of all the other codes.

Thanks in advance,

 

stevejoyce
Specialist II
Specialist II

in my original post i used -= this is not equal.  so you can use the same for #3.

Count({<Hoofddieetcode -= {111,2911,112,113,114,115,116,2912,2913,2914,2915,2916} >} Hoofddieetcode)

JackR
Contributor II
Contributor II
Author

many thanks to Stevejoyce, this results is wished outcome, the count-function for group 3 is:

Count({<[Hoofddieetcode]-= {111,2911,112,113,114,115,116,2912,2913,2914,2915,2916}, [Naam productiestroom] -= {'Tussendoor'}>} Hoofddieetcode)