Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
DavidFoster1
Specialist
Specialist

Set analysis sum of others question

Hi all.

I have a data set with customer sales by branch of a retail company.

The report requirement is provide the following

BranchCustomerLocal SalesOther Branches
AJohn Smith£1000£2000
BJohn Smith£1500£1500
CJohn Smith£500£2500

I then need to be able to filter down to a single Branch record and the values remain the same.

The problem is how to achieve the 'Other Branches' total. My attempts at using set analysis to use the Excluded branches caused the Branch dimension values to appear even though they were filtered.

Any help appreciated.

1 Solution

Accepted Solutions
DavidFoster1
Specialist
Specialist
Author

Got it! Proper deep dark stuff!

AGGR(NODISTINCT SUM({1} SALES),CUSTOMER) - SUM(SALES)

View solution in original post

19 Replies
joshabbott
Creator III
Creator III

The set analysis should be centered around the {1} I would think.  Could you let us know your expression for the 'Other Branches' column you are having problems with?

MK_QSL
MVP
MVP

Create a Straight Table

Dimension

Branch

Customer

Expression

SUM([Local Sales])

SUM(ALL [Local Sales])  - SUM([Local Sales])

VishalWaghole
Specialist II
Specialist II

Hi David,

You can also use,

=Sum(TOTAL LocalSales) - sum(LocalSales)

-- Regards,

Vishal Waghole

DavidFoster1
Specialist
Specialist
Author

SUM({$<Branch=>} Sales) - SUM(Sales)

DavidFoster1
Specialist
Specialist
Author

Sorry but neither of the ALL or TOTAL suggestions work because there will be multiple customers in the list (should have made that more explicit)

MK_QSL
MVP
MVP

Can you please post your sample test data in excel file?

Not applicable

Hello David,

Can you post a sample app?

Did you try using P() and E() in set analysis. That might help in this case.

Thanks,

Singh

simenkg
Specialist
Specialist

sum({1}Total Sales) - sum(Sales)

DavidFoster1
Specialist
Specialist
Author

Sample Data

BRANCH

CUSTOMERSALES
AJOHN SMITH1000
AJOE BLOGGS1500
AJANE DOE500
BJOHN SMITH2000
BJOE BLOGGS2500
BJANE DOE500
CJOHN SMITH3000
CJOE BLOGGS0
CJANE DOE

1000

and the result I am looking for that can be filtered down to a single branch and only show 3 rows.

BRANCHCUSTOMERLOCAL SALESOTHER BRANCHES
AJOHN SMITH10005000
AJOE BLOGGS15002500
AJANE DOE5001500
BJOHN SMITH20004000
BJOE BLOGGS25001500
BJANE DOE5001500
CJOHN SMITH30003000
CJOE BLOGGS04000
CJANE DOE10001000