Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
adambrian
Not applicable

count in selectedfield

Hi,

i want to count people by id where when i select department A.

Count({<department=getfieldselections>} id)

and i want count people not in department A when i select department A.

Count({<department=getNotfieldselections>} id)


anyone help me to solve this one.

Thanks,
Adam

1 Solution

Accepted Solutions
vinieme12
Not applicable

Re: count in selectedfield

to count people by id where when i select department A.

Count(Distinct id)

count people not in department A when i select department A.

Count({<department,department=E(department)>}Distinct id)

16 Replies
Chanty4u
Not applicable

Re: count in selectedfield

try this

Not tested.

=count({1<Department=P()>} id)


and


=count({1<Department=E()>} id)

prat1507
Not applicable

Re: count in selectedfield

You can use the below expression:


count people by id where when i select department A.

Count({<department ={'$(=GetFieldSelections(department ))'}>}id)


count people not in department A when i select department A.

=Count({<department =>}id)-

Count({<department ={'$(=GetFieldSelections(department ))'}>}id)

Regards

Pratyush

vinieme12
Not applicable

Re: count in selectedfield

to count people by id where when i select department A.

Count(Distinct id)

count people not in department A when i select department A.

Count({<department,department=E(department)>}Distinct id)

vinieme12
Not applicable

Re: count in selectedfield

There is no need for GetfieldSelections() buddy , remember qlikview is Associative

adambrian
Not applicable

Re: count in selectedfield

Thanks for your right answer. it run well..

the are a few question i want to ask you:

there ada a few units under one department.

for example there are 3 department, which department A,department B, department C

and there 4 units under each department which unit1, unit2, unit3, unit3

my question:

1) when i select department A, how can i count total staff(id) in department B and C.

2) can i show total staff in selected department and selected unit in selected department in same time. for example if i select unit1 in department A, can i show in text & image extension :

what department selected : total staff in selected department

what unit selected : total staff in selected unit

adambrian
Not applicable

Re: count in selectedfield

Thanks for your right answer. it run well..

the are a few question i want to ask you:

there ada a few units under one department.

for example there are 3 department, which department A,department B, department C

and there 4 units under each department which unit1, unit2, unit3, unit3

my question:

1) when i select department A, how can i count total staff(id) in department B and C.

2) can i show total staff in selected department and selected unit in selected department in same time. for example if i select unit1 in department A, can i show in text & image extension :

what department selected : total staff in selected department

what unit selected : total staff in selected unit

ishanbhatt
Not applicable

Re: count in selectedfield

Hi Adman,

You can directly use "Count function" for getting selected department count and for rest count used "GetExcludedCount function".

or Getting Selected Department Count use

=Count(Employee ID)

And for getting excluded count use

=GetExcludedCount(Employee ID)

Please find the attached Qlikview Document for example.

vinieme12
Not applicable

Re: count in selectedfield

my question:

1) when i select department A, how can i count total staff(id) in department B and C.

          Count({<department,department=E(department)>}Distinct id)

i select unit1 in department A, can i show in text & image extension :

what department selected : total staff in selected department

In a Text Object:  Total by Departement on selection of Unit

        ='Department ' & Department &'  : ' Count({<unit, Department = p(Department)>}Distinct id)


what unit selected : total staff in selected unit

In a Text Object:  on selection of Unit Total for Selected Unit is

           ='Unit ' & Unit &'  : ' Count(Distinct id)

adambrian
Not applicable

Re: count in selectedfield

Thank Vineeth with your correct.

I want to show what i select, if i select department, it show department and if i select unit, it show unit in one text..
do you know how to do it?