Hopefully this is simple and I am just missing something. I am new to using Qlik Sense.

I have purchasing data with year, commodity and vendor. I want to be able to create 2 charts as follows.

Chart #1

Dimension 1 = year, Dim 2 = Commodity. Measure = sum of spend for each commodity. I want one stacked bar for each year showing the top 10 commodity spend amounts. I can do this with a regular bar chart, but when I change to a stacked bar, the limitation capability disappears and the stacked bar shows ALL commodities for each year. Is this because the Top 10 are not the same for each year? If so, why does it work in the regular grouped bar chart which can show a different Top 10 for each year?

You can do that. The trick is to use SET ANALYSIS in your measure expression to focus the data set to the top 10.

If your measure is say, sum(Sales)

Use the following SET Statement to focus it to the 10 countries with the most sales

Sum( {$<Country={"=rank( total sum(Sales))<=10"}>} [Sales] )

... in this statement, '$' means that the set of data will respond to all user filters . The '<Country={"=rank( total sum(Sales))<=10"}>' means that Country (no matter if a user selects a country filter in the dashboard) will always be the top 10 countries by sum(Sales).

You can use this for #2 .

Your last question is not really possible right now, although you can use the above technique to a point to do this anywhere you use an aggregation function . ( SET ANALYSIS is valid within the context of a chart aggregation).

Here i am using the p() function to gather a subset of countries (top 10 in Year=2005 regardless of other user filters) , and always plot those same 10 customers by year (and filter the Sales number by user selection)

There are a few things going on here to ensure i'm grabbing the right context at each level of the expression so let me know if you need further explanation.