# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for
Did you mean:
Not applicable

## Set Analysis

Hi,

If I wanted to limit a calculation to certain dimension but still let the expression be effected by selection within those categories, how can I do that.

For example, If I want a chart to take the salary sum of only IT and consultants department, my set analysis would be like

sum({<Department = {'Consultants','IT'}>} salary)

It gives me salaries sum of only these two departments

However, If I would like this chart to be still selectable within these two departments, how can I do that. If from the listbox, I select either IT or consultants, it should show me the data only for that department. If no selection is made or any other department is selected, then show sum of both

Arif

6 Replies
Not applicable
Author

\$ = current selection.

Regards

Pavan.

Specialist

Hi Arif,

Try:

if(Match(GetFieldSelections(Department),'IT','Consultants'),

Sum(Salary),

Sum({<Department={'IT','Consultants'}>}Salary))

edit: removed > 0 as realised from anbu's post this isn't needed!

Master III

If(Match(GetFieldSelections(Department),'Consultants','IT'),sum({<Department = {'\$(=GetFieldSelections(Department))'}>} Salary), sum({<Department = {'Consultants','IT'}>} salary))

Specialist

You can also use IF function

=IF(Dept='IT' OR Dept='Consultant',SUM(Salary))

Not applicable
Author

Your solution is te separation of you two set analysis: sum({<Department = {'Consultants'}>} salary) + sum({<Department = { 'IT'}>} salary)

MVP

Hi, you can use an operator to filter intersections:

sum({<Department *= {'Consultants','IT'}>} salary)

Community Browser