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

Getting all possible for a dimension (Set Analysis)

I need set analysis where if "Hammer" is selected from the below data it will add all Salary and Revenue for that specific Region (which is "East") because Hammer belongs to that Region.

   

Thanks,

Z

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi Steve,

try

Sum({<Region=P(),Department>} Revenue)

Regards,

Antonio

View solution in original post

3 Replies
vishsaggi
Champion III
Champion III

Try this?

LOAD * Inline [

Region, Department, Salary, Revenue

EAST, Nails, 4000, 50000

EAST, Hammer, 5000,

WEST, Screws, 6000, 60000

WEST, Saw, 7000, 70000

];

Using straight table:

Add no dimensions

Add Expressions like:

Salary

= IF(GetSelectedCount(Department) > 0, Aggr(Sum(Salary), Department), Sum(Total Salary))

= IF(GetSelectedCount(Department) > 0 AND Sum(Total Revenue)= 0 , Aggr(Sum({<Department=>} Revenue), Region), Aggr(Sum(TOTAL Revenue), Department))

antoniotiman
Master III
Master III

Hi Steve,

try

Sum({<Region=P(),Department>} Revenue)

Regards,

Antonio

zagzebski
Creator
Creator
Author

Thanks. Worked!

Z