Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vanand3535
Creator III
Creator III

Percentage in Stacked Bar Chart

I have a bar chart with

1-Dimension

3-Measure

All the 3 measures have different filters applied to it

When I am trying to find the percentage I'm not able to get 100%

Sometimes I'm getting more than 100% , sometimes less than 100%

As of now i'm using the formula for percentage is:-

count(fields)/count(total fields)

or

sum(fields)/

sum(total fields)

23 Replies
YoussefBelloum
Champion
Champion

try to upload this QVF in your Qliksense environment and tell me what is missing

vanand3535
Creator III
Creator III
Author

I have also tried this. It's working fine.

But use any three measure(sales, country, product  or etc..) and try to show the percentage in 100% in stacked bar chart

That I need to display.

Is this possible to use three measure in a stacked bar chart and show their percentage in 100%?

YoussefBelloum
Champion
Champion

What do you mean by "show the percentage in 100%" ?

can you show the expected output via an Image ?

hacr
Creator
Creator

Just a note... you can't take a SUM of a string. And I believe you want to make 2 dimensions and 1 measure.

vanand3535
Creator III
Creator III
Author

Suppose  I have three measure :-

1.Sales

2.profit

3.Discount

Then each bar in bar chart should show------> Sales%+Profit%+Discount%=100%

hacr
Creator
Creator

Something like this ?2018-04-11_10h32_12.png

Selecting a single/multi category will yield 100% (if one selected) as it make up the whole selection.

2018-04-11_10h34_31.png

vanand3535
Creator III
Creator III
Author

yes...all the measure in each bar of bar chart and total should be equal to 100% after adding all the measures in each bar

vanand3535
Creator III
Creator III
Author

See the image attached below

the sum of the 3 measure is not equal to 100% in each bar only in one bar it is 100%

Screenshot (671).png

YoussefBelloum
Champion
Champion

Ok, I see

let's suppose we have 3 measure: Sales, Profit, Discount like you mentioned above, you should have something like this on the expression using a STACKED bar chart:

Sales expression: =sum(sales)/sum(TOTAL sales)

profit expression: =sum(profit)/sum(total profit)

discount expression: =sum(discount)/sum(total discount)

make sure to format in %

vanand3535
Creator III
Creator III
Author

same thing is applied:-

Sales expression: =sum(sales)/sum(TOTAL sales)

profit expression: =sum(profit)/sum(total profit)

discount expression: =sum(discount)/sum(total discount)

make sure to format in %

But not getting 100% in each bar