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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jorgen_santberg
Contributor III
Contributor III

Total sum of sales with selections

Hi all,

 

I have a a straight table with the following dimensions:

- Customer

- Type

      - Brand

            - Article

And the expression Sum(Sales)

 

Where brand is a subcategory of type and article is a subcategory of brand.

 

What I need is the total sales per type per customer. That can be done by 

Sum(Total <Type,Customer> Sales)

But if I select 1 article  it gives only the sales of this article.

 

When I use Sum({<Article>} Total <Type,Customer> Sales) it gives me the right sum of sales after selecting an article but

it still shows all articles  (with sales 0 as a result). I want only the selected article to be shown.

 

Any one got the solution for this? Thanks!

 

Labels (2)
1 Solution

Accepted Solutions
justISO
Specialist
Specialist

Hi, I suggest to use aggregation by type and customer and ignore selection of article, so something like this:

aggr(nodistinct sum({<Article=>} Sales), Type,Customer)

View solution in original post

2 Replies
justISO
Specialist
Specialist

Hi, I suggest to use aggregation by type and customer and ignore selection of article, so something like this:

aggr(nodistinct sum({<Article=>} Sales), Type,Customer)

jorgen_santberg
Contributor III
Contributor III
Author

Yes, works perfect. Many thanks!