Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

percentages on stacked chart

Hi ,

i have a stacked bar chart, where i want to display percentages insread of values on the data points.

Total bar value is 100% and every color represents its contribution.

PLease find the attached picture.

1 Solution

Accepted Solutions
Highlighted

For two expression you can do this:

Expression1:

Expression1/RangeSum(Expression1, Expression2)

Expression2:

Expression2/RangeSum(Expression1, Expression2)

Replace Expression1 and Expression2 with your existing Expressions in your chart.

View solution in original post

10 Replies
Highlighted

Assuming this is what your current expression is -? Sum(Sales), try changing it to this:

Sum(Sales)/Sum(TOTAL <FirstDimensionHere> Sales)

Highlighted
Specialist
Specialist

Did you try to check the relative in the expression?

Capture.PNG

Highlighted

Relative with two dimensions is probably going to calculate the percentage based on the total which probably won't work for Mark

Highlighted
Specialist
Specialist

I may not understand what exactly you mean, however, I just tested out a simple example with 2 dimensions and it is based out the total of first dimension when checking relative.(which i think it is your set analysis means)

Highlighted

See the difference between the two charts in the image below

Capture.PNG

Top image is using Relative and the bottom one uses this expression -> =Sum(Value)/Sum(TOTAL <Dim1> Value)

Script used:

Table:

LOAD * Inline [

Dim1, Dim2, Value

A, C, 10

A, D, 20

B, C, 15

B, D, 12

];

Highlighted
Specialist
Specialist

Sunny,

Really Thanq verymuch for your time and patience brother.

In my application, the stacked chart is comprised of 2 expressions.

I think that's the reason.

Let me share the application please.

Highlighted

For two expression you can do this:

Expression1:

Expression1/RangeSum(Expression1, Expression2)

Expression2:

Expression2/RangeSum(Expression1, Expression2)

Replace Expression1 and Expression2 with your existing Expressions in your chart.

View solution in original post

Highlighted
Specialist
Specialist

Thanq Sunny

Highlighted

No problem at all Mark