
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to I preserve "percentage of total" when filtering by dimensions?
I am extremely new to Qlik
I have a data set based on sales data.
Year
Month
Country
Region
Product Category
Product Name
Quantity Sold
etc
I have 2 bar charts which are exactly the same - Quantity Sold by Product Name - except that one chart shows the quantity in values and the other is relative - i.e. as a percentage of total quantity.
How to I preserve this percentage when filtering by product name?
At the moment, if I select product x, chart 1 still shows quantity sold = 27,457 units, however, chart 2, rather than showing 3.12% of all units sold, now shows 100% of all units sold as it is only including product x in the total.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use set analysis to ignore the dimensions in that expression.
Like for chart 2, something like this
= Sum({<ProductName>}QuantitySold)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't use the relative option on expression tab, if that's what you are currently using.
Instead, create a percentage calculation like
=Sum([Quantity Sold]) / Sum(TOTAL [Quantity Sold])
i.e. use the TOTAL qualifier to ignore the chart dimensions.
Then use set analysis to ignore the selections in your dimension field [Product Name] or to ignore any selections:
=Sum([Quantity Sold]) / Sum({<[Product Name]=>} TOTAL [Quantity Sold])
or
=Sum([Quantity Sold]) / Sum({1} TOTAL [Quantity Sold])


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
a bit to late, but maybe helpful:
regards
Marco
