Qlik Community

QlikView Publisher

Discussion Board for collaboration on QlikView Publisher.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
mark6505
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

gupta_n8
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)

vinieme12
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

galax_allu
Not applicable

Re: Need help on How to use count ?

Hi

please find the QVW as per your requirement .

I am assuming  Empid is the field name :Associate Number

MindaugasBacius
Not applicable

Re: Need help on How to use count ?

Screenshot_1.jpg

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 ?

Please help me on this thing also.

Thank You !

Regards,

Animesh