Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
adambrian
Contributor III
Contributor III

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

16 Replies
adambrian
Contributor III
Contributor III
Author

i tried this but not function..

if(GetFieldSelections(department),department,

if(GetFieldSelections(unit),unit, 'others'))

vinieme12
Champion III
Champion III

it should be

=if(Getselectedcount(Department)>0, YourExpression for department

     ,if(Getselectedcount(Unit)>0 , YourExpression for Unit))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
adambrian
Contributor III
Contributor III
Author

Hi Pratyush,

i tried this one but has error. can you help me this one?

count people by id where when i select department A.

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

prat1507
Specialist
Specialist

Hi adam

This will only work for Single selections, not for multiple selections. You've to use Vineeth's expression for multiple selections. Please let me know what you need exactly.

Regards

Pratyush

prat1507
Specialist
Specialist

Hi Adam

If you want to see your selections, you can use =GetCurrentSelections().

Regards
Pratyush

adambrian
Contributor III
Contributor III
Author

Hi,

Sorry, I have a few question again, can you help me

2017-02-20 06_08_04-soalan.xlsx - Excel.png


I want to calculate and show in pie chart, if i select any UNIT and need to compare same UNIT=OLD_UNIT.

For example i select unit1 in department A:


1) show GROUP count by STAFF_ID where if i select an@y unit getfieldselections(UNIT) and if UNIT=OLD_UNIT


2) show DEPARTMENT count by STAFF_ID where count all STAFF_ID except unit1 in department A.

getNotfieldselections(UNIT) and if UNIT=OLD_UNIT


And what should i put in Dimensions and Measure field?


@vinieme12 @prat1507

vinieme12
Champion III
Champion III

can you post an excel file and also confirm expected outputs?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.