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

Calculated percentage in Bar Chart

The chart below represents a total count for each of the segmented fields (Green, Yellow, Red). Each of the segments is a calculated dimension. Can someone please help me turn this data into percentages? The Y axis should be 0% - 100% and each segment of each bar should be a percentage thereof. Also, how do you get the numbers to appear in each segment rather than below, on the X axis?

Can someone please help?

Thank you!!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

HI Lee:

I think you should calculate the proportion representing each expression with respect to the total.

Look at the attachment, to see if it is what you want.

View solution in original post

11 Replies
Gysbert_Wassenaar

Change your expressions so that they are divided by the sum of all expressions:

Count({<ActualNumeric={">0"}>} If(ActualNumeric>SpLimitLowValue and ActualNumeric<SpLimitUpperValue, ActualNumeric))

/rangesum(

Count({<ActualNumeric={">0"}>} If(ActualNumeric>SpLimitLowValue and ActualNumeric<SpLimitUpperValue, ActualNumeric)),

Count({<ActualNumeric={">0"}>} If(ActualNumeric>Lower_value and ActualNumeric<Upper_value, ActualNumeric)),

Count({<ActualNumeric={">0"}>} If(not (ActualNumeric>SpLimitLowValue and ActualNumeric<SpLimitUpperValue) or

    (ActualNumeric>Lower_value and ActualNumeric<Upper_value), ActualNumeric))

    )

Change the Number format to Fixed to with as many decimals as you want and enable the Show as Percentage option. Disable the Text on Axis option, enable the Values on Data Points option and on the Presentation tab enable the Plot Values in Segments option.


talk is cheap, supply exceeds demand
sunny_talwar

Like this?

Capture.PNG

Anonymous
Not applicable
Author

HI Lee:

I think you should calculate the proportion representing each expression with respect to the total.

Look at the attachment, to see if it is what you want.

rubenmarin

Hi Lee, looking the data I think the expressions should use different fields, I have changed it, please take a look:

Not applicable
Author

Wow that's perfect! Thank you

Not applicable
Author

Thank you everyone!!!

Not applicable
Author

Maria,

How did you get the data points to display on each segment?

Not applicable
Author

Thanks for your help, but using what you gave me yesterday, I got it right.

Anonymous
Not applicable
Author

In Properties->Presentation, check the option 'Plot Values Inside Segments'.

points in segments.png