Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis query

Hello

I’m new to Set Analysis, in the table I’m trying to calculate the total Sales for each Group but only if the Customer is selected. I would want the total Sales by the latest year.

    

    

CustomerGroupSalesYear
Cust Agroup 1       25,000 2015
Cust Bgroup 1       20,000 2015
Cust Cgroup 1       35,000 2015
Cust Agroup 1       30,000 2014
Cust Bgroup 1       20,000 2014
Cust Dgroup 2       15,000 2014
Cust Dgroup 2       40,000 2015
Cust Egroup 2       25,000 2015

Any help would be appreciated.

Thanks in anticipation

1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Jim,

This seems to work:

Sum({$<Customer=, Group = P({<Group>})>}Sales)

Cheers

Andrew

View solution in original post

4 Replies
sunny_talwar

Not sure what the exact output needs to look like, but may be this:

Sum(TOTAL <Group> {<Customer, Group = p(Group)>}Sales)

effinty2112
Master
Master

Hi Jim,

This seems to work:

Sum({$<Customer=, Group = P({<Group>})>}Sales)

Cheers

Andrew

rajpreeths
Creator
Creator

Hi Jim,

You can try with this expression for obtaining the total sales by latest year.

Sum({<Group=P(Group),Year={$(=Max(Year))}>}Sales)

And if you want to show the data only if the customer is selected then you can try with calculated condition functionality available in the General tab of chart properties.

Calculated.PNG

PFA the file for further reference.

Hope this helps 🙂

Br,

Rajpreeth S

Not applicable
Author

Thanks Andrew and Sunny T - both solutions work perfectly. Thanks again for responding so quickly, much appreciated.

Jim