Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Stacked charts with filtering

Hi everyone,

I am new to Qlik Sense. I am trying to build a stacked bar char on line chart over a table of categorized data. I want to show the data stacked based on category.

I have added a measure for each category with the following expression:

Sum({<Category = {"CAT_A"}>} Cost)

I also have a table next to my chart which has list of all categories. When I click on specific category in my table, I want to filter out all other categories in may chart and only show the selected category, but my stacked line chart does not respond to my selection, and I could not figure out how to fix it. I appreciate if someone could point me to a direction?

1 Solution

Accepted Solutions
OmarBenSalem
Esteemed Contributor

Re: Stacked charts with filtering

I'll assume that you CAT dimension is named Category.

Here's what you do:

Use a line chart (presentation > use zone)

keep your time dimension

Add another dimension: Category

as a measure: Only have 1 measure: Sum(Cost)

When you filter with a CAT you'll only have the stacked CATs.

Per analogy in the example below:

Dimension 1: Year

Dimension 2 : Region

Measure: sum(carSales)

Filter: Region

Result:

Capture.PNG

6 Replies
OmarBenSalem
Esteemed Contributor

Re: Stacked charts with filtering

Can you provide a sample QVF app to work with? or at least an image?

And what dimension you're using?

and how many measures?

Not applicable

Re: Stacked charts with filtering

Dimension is time, "billing period" to be more accurate. And I have about 25 measures (categories). I have not plot them all yet, because I figured out my approach is not working.

Let me see if I can provide you with an image.

Not applicable

Re: Stacked charts with filtering

SampleChart.JPG

Here is an image. I want to only show CAT A when I click on CAT A on the left hand side table.

OmarBenSalem
Esteemed Contributor

Re: Stacked charts with filtering

I'll assume that you CAT dimension is named Category.

Here's what you do:

Use a line chart (presentation > use zone)

keep your time dimension

Add another dimension: Category

as a measure: Only have 1 measure: Sum(Cost)

When you filter with a CAT you'll only have the stacked CATs.

Per analogy in the example below:

Dimension 1: Year

Dimension 2 : Region

Measure: sum(carSales)

Filter: Region

Result:

Capture.PNG

Not applicable

Re: Stacked charts with filtering

Thanks a lot. It worked

OmarBenSalem
Esteemed Contributor

Re: Stacked charts with filtering

Great to hear !

don't forget to close the thread by marking the correct answer as so.

Have nice days