Skip to main content
cancel
Showing results for 
Search instead 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

Try using $ sign in the above example.

$ = current selection.

Regards

Pavan.

morganaaron
Specialist
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!

anbu1984
Master III
Master III

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

ashwanin
Specialist
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)

rubenmarin

Hi, you can use an operator to filter intersections:

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