Qlik Community

QlikView Publisher

Discussion Board for collaboration on QlikView Publisher.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Need help on How to use count ?

Hello Everyone,

I need one assistance in creating a formula on counting the no of employee based on their EmpId when 'Type of Program'- value is

'"Occ P.I." , "Occ T.I.", and "Occ TWP". I am currently using this formula-

=((if(ProgramTerm='Occ TWP',Count(EmpId),0)) + (if(ProgramTerm='Occ T.I.',Count(EmpId),0))+(if(ProgramTerm='Occ P.I.',Count(EmpId),0)))

But it is only giving the result count of "Occ TWP". I wanna how to get the total count of this .

Please find attached excel file along with this that contains those values.

Any help would be greatly appreciated !

Thank You ! 

11 Replies
Highlighted
Partner
Partner

Hi

Try

Count({<[ProgramTerm]={'Occ TWP'},>}DISTINCT EmpId) + Count({<[ProgramTerm]={'Occ T.I'},>}DISTINCT EmpId) +

Count({<[ProgramTerm]={'Occ P.I'},>}DISTINCT EmpId)

Any doubts split them out and check the results.

Mark

Highlighted
Specialist II
Specialist II

You can use this also

Count({<[ProgramTerm]={'Occ TWP','Occ T.I','Occ P.I'}>}EmpId)

Highlighted
Champion II
Champion II

Count({<[ProgramTerm]={'Occ TWP','Occ T.I','Occ P.I'}>} DISTINCT EmpId)  << add distinct if you have duplicates and want to count only unique values

Highlighted
Specialist
Specialist

Hi

please find the QVW as per your requirement .

I am assuming  Empid is the field name :Associate Number

Highlighted
Specialist III
Specialist III

Screenshot_1.jpg

Check the attachment please for available options.

Highlighted
Not applicable

Hi Mark ,

Thanks it is working now. I have one more query of you can help . I and trying to use greater than and  less than value like the range of value to count . using this formula-

= Count({<[Length] = {">=63" and "<=84" } >}Distinct Empid)

But it is not working and throwing . Please correct this formula , where and what I am missing ?

Highlighted
Not applicable

Hi Vineeth,

Thanks it is working now. I have one more query of you can help . I and trying to use greater than and  less than value like the range of value to count . using this formula-

= Count({<[Length] = {">=63" and "<=84" } >}Distinct Empid)

But it is not working and throwing . Please correct this formula , where and what I am missing ?

Highlighted
Not applicable

Hi Mindaugas,

Thanks it is working now. I have one more query of you can help . I and trying to use greater than and  less than value like the range of value to count . using this formula-

= Count({<[Length] = {">=63" and "<=84" } >}Distinct Empid)

But it is not working and throwing . Please correct this formula , where and what I am missing ?

Highlighted
Not applicable

Hi Everyone ,

Thanks it is working now. I have one more query of you can help . I and trying to use greater than and  less than value like the range of value to count . using this formula-

= Count({<[Length] = {">=63" and "<=84" } >}Distinct Empid)

But it is not working and throwing . Please correct this formula , where and what I am missing ?

Please help me on this thing also.

Thank You !

Regards,

Animesh