Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
TobiasTebben
Contributor III
Contributor III

Stacked bar charts for n customers and a fixed number of years

Dear Qlik-Community,

I must be using the search engine incorrectly because I cannot find a solution to a question that must have been asked previously. So please excuse my asking again.

My data is pretty straightforward. I have one measure: sales figures. I have two dimensions: customers and years. But the customer base varies from year to year. So lets say my total sales in 2019 come from 10 customers, my total sales in 2020 from 12 customers and my total sales in 2021 from 15 customers.

I want my visualization to be three bars, one for each year. And each of these three bars should be stacked so that the total height of each bar shows the total sales of that year, with the n (10, 12, 15) customers represented by segments of the bars. 

Can this be done? The only solution I can think of is using ‘year’ as the dimension in my bar chart and then defining my measure (sales) 15 times with a set analysis to differentiate between customers. For obvious reasons this solution is not feasible… There must be a better way?!

Your help is highly appreciated!

Labels (1)
1 Solution

Accepted Solutions
TobiasTebben
Contributor III
Contributor III
Author

Thank you DeepanshuSh! While following your advice to design a minimal example, I found the solution myself. I don’t know why I didn’t see it right away, maybe it did not expect it to be SO easy 😉

Thanks for leading me on the right track!

If anyone has the same problem and finds this thread: you can simply add customers as a second dimension.

View solution in original post

2 Replies
deepanshuSh
Creator III
Creator III

Maybe I am misinterpretating, but you want to show the sales based on the customers year wise in stacked bar chart manner. And you are stuck with getting the sales values with customers as another dimension?

 

If my above inference is correct, then can you showcase the sample data and linkage between sales and customer if any. Also, can you share the measure that you are using to get the sales. 

Trial and error is the key to get unexpected results.
TobiasTebben
Contributor III
Contributor III
Author

Thank you DeepanshuSh! While following your advice to design a minimal example, I found the solution myself. I don’t know why I didn’t see it right away, maybe it did not expect it to be SO easy 😉

Thanks for leading me on the right track!

If anyone has the same problem and finds this thread: you can simply add customers as a second dimension.