Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
KDoyle
Contributor II
Contributor II

Creating one stacked bar with percentages

I'm trying to recreate the attached bar chart in Qlik, where the y axis shows (for example) 'Type of Payment' as one stacked bar and the x axis shows 'Total Spend' with percentage labels for each stack of the bar. Is this possible in Qlik and if so is someone able to assist in showing me how to replicate this? 

In short, I want to show one dimension as one stacked bar and assign a percentage of total spend to each stack in that one bar. 

Thanks! 

Labels (2)
8 Replies
Or
MVP
MVP

This looks like a regular horizontal stacked bar chart with value labels. Is there some complexity I'm not seeing? If not, this is what you should be using.

Or_0-1701346112993.png

 

KDoyle
Contributor II
Contributor II
Author

It looks like you have more than one dimension in that example? I want to be able to show one dimension as a stacked bar (i.e. payment type is the dimension, so each payment type to be stacked on top of each other). And then I want to show each of those as a percentage of the x axis, 'Total Spend'.

At the moment the  one dimension I have is showing as separate bars, but I want to stack these...and then assign percentage values to each stack. 

I'm new to Qlik but from the training I've received this doesn't seem obvious, sorry if it is!

Or
MVP
MVP

That is how a stacked bar chart most commonly works, but if you have your spends as different measures rather than members of a dimension, you can just use multiple measures and the same object type will work. Note that your measures will need to be something like:

Sum(SpendType1) / Sum(TotalSpend)

Sum(SpendType2) / Sum(TotalSpend)

etc.

 

KDoyle
Contributor II
Contributor II
Author

Is this possible without changing the original data set? 

 

Or
MVP
MVP

Nothing I've suggested so far requires making any changes to the data set, so I'm not sure what you mean...

KDoyle
Contributor II
Contributor II
Author

You mentioned having payment type (which I think you refer to as Spend Type) as different measures rather than members of a dimension? I don't know how to separate them out into different measures...this results in an error. Are you able to break down further if possible. 

 

Or
MVP
MVP

I suggested what the formula might look like in a previous post if you currently have them as separate fields rather than as members of a dimension (in which case the dimension would be used rather than multiple measures). I'm afraid I can't suggest anything beyond that with the information you've provided.

Sandrajude
Contributor
Contributor

Yes, it's absolutely possible to create a stacked bar chart with percentages in Qlik. Here's a general guide on how you can replicate this:

  1. Data Preparation: Ensure your data is structured properly with the necessary dimensions and measures. You'll need at least one dimension (e.g., Type of Payment) and one measure (e.g., Total Spend).

  2. Load Data into Qlik: Load your data into Qlik Sense or QlikView.

  3. Create a Stacked Bar Chart: In Qlik's visualization interface, create a stacked bar chart. Drag your dimension (e.g., Type of Payment) to the dimension axis and your measure (e.g., Total Spend) to the measure axis.

  4. Add Percentage Labels: Qlik has built-in functionality to add expression labels to your chart. You can create an expression to calculate the percentage of total spend for each stack in the bar. Here's an example of how you can do this:

=sum([Total Spend]) / sum(total [Total Spend])

This expression calculates the percentage of total spend for each category. Make sure to adjust it according to your actual field names. I remember how I had some problems with payment in games. Then I did not want to search for a long time and a friend advised me https://playsafecasino.ca/1-dollar-deposit-casinos/ this is a really reliable and convenient resource. There you can make a deposit from 1 dollar.

5. Apply Formatting: Format your chart as needed, including adjusting colors, labels, and axes.

6. Finalize and Save: Once you're satisfied with your chart, save it to your Qlik app or dashboard.