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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
profilejamesbond
Creator II
Creator II

Set Analysis Adjustment for the specific product

Hi,

I have Sales by Products.

For example:

Product, Sales

A, 1

B, 2

C, 3

 

I wrote set analysis with Sum of Sales for the Product A

=Sum ({<Product = {A}>} Sales)

 

Now, set analysis shows me the Sales of Product A when Product A selected or there is no selection for the Product.

Problem is when I select the Product B or C then I don't see anything in the set analysis it shows me -.

Object is to show the Sum of Sales for the Product A whether the Product A selected or not also show me the sales for the Product A even Product B or C selected. I mean I don't want to include Product B or C in any case.

 

Thanks

 

Labels (2)
4 Replies
Vegar
MVP
MVP

If your data model and expression is as you describe then Sum ({<Product = {A}>} Sales) should be enough, but if you are making selections in any other field then that will effect your measure. 

Example:

If you  set analysis is done on product_id, but your users filter on Product then the - will appear. 

  • Sum ({<product_id = {A}>} Sales)
  • User filters on Product=B
  • The output will be null because a filter on product_id=A and Product=B give no result

If possible change either the set expression or the filter given to the users. Or clear out the user filter in the modifier like this:

Sum ({<Product=, product_id = {A}>} Sales)

profilejamesbond
Creator II
Creator II
Author

Hi @Vegar,

There is no parent category. Just as simple as it is.

But, how to write an expression where I would like to say just select this product and whatever the selection is inside the same dimension just ignore it.

I tried these modifiers but no luck:

Product = {'A'}, Product =

Product = {'A'}, Product -= {'B', 'C'}

Product = {'A'}, Product = e(Product)

 

Thanks

Vegar
MVP
MVP

It seems like you are leaving out some details in your explanation.

If you have the data as scripted below

product_sales_data:
LOAD * inline [
   Product, Sales
   A,       1
   B,       2
   C,       3
];

Then the expression sum({<Product = {'A'}>}Sales) should ignore any selections made to the Product dimension. See screenshot below - I've made a selection to Product = B, but that expression still calculates only for the A product despite the selection.

Vegar_0-1760130350044.png

 

howdash
Creator II
Creator II

Have you tried this:

Sum ({<Product -= {‘B’, ‘C’}>} Sales)

This tells Qlik Sense to sum sales for products that are not B or C - in your example, that would be sales for product A only.