# QlikView Publisher

Discussion Board for collaboration on QlikView Publisher.

Announcements

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
Not applicable

## Re: Need help on How to use count ?

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

Not applicable

## Re: Need help on How to use count ?

You can use this also

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

Not applicable

## Re: Need help on How to use count ?

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

Not applicable

## Re: Need help on How to use count ?

Hi

I am assuming  Empid is the field name :Associate Number

Not applicable

## Re: Need help on How to use count ?

Check the attachment please for available options.

Not applicable

## Re: Need help on How to use count ?

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 ?

Not applicable

## Re: Need help on How to use count ?

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 ?

Not applicable

## Re: Need help on How to use count ?

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 ?

Not applicable

## Re: Need help on How to use count ?

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 ?