Skip to main content
Announcements
Qlik Launches Open Lakehouse and advanced agentic AI experience in Qlik Answers! | LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

3 Replies
vishsaggi
Champion III

Use set analysis to ignore the dimensions in that expression.

Like for chart 2, something like this

= Sum({<ProductName>}QuantitySold)

swuehl
MVP

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])



The Aggregation Scope

MarcoWedel

Hi,

a bit to late, but maybe helpful:

QlikCommunity_Thread_266211_Pic1.JPG

QlikCommunity_Thread_266211_Pic3.JPG

QlikCommunity_Thread_266211_Pic2.JPG

regards

Marco