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

percentages in stacked bar chart

Hi All,

I have attempted adding percentages to a pop up for stacked bar chart a few different ways but am not having much success. I have tried creating the stacked bar charts 2 different ways:

DIM:

PaymentCategory (IP-Surgical, Tests, Hospice, SNF, etc.)

Organization (Org1, Org2, Other)

EXPRESSION: PMPY $

(SUM(pay_amt)/(SUM(TOTAL MemberMonths)))*12

vs

DIM:

PaymentCategory

EXPRESSIONS:

Org1 PMPY $

(SUM({<Organization={'Org1'}>}pay_amt)/(SUM(TOTAL MemberMonths)))*12

Org2 PMPY $

(SUM({<Organization={'Org2'}>}pay_amt)/(SUM(TOTAL MemberMonths)))*12

Other  PMPY $

(SUM({<Organization={'Other'}>}pay_amt)/(SUM(TOTAL MemberMonths)))*12

Each of these methods creates a stacked bar chart with 3 stacked pieces in each bar showing the PMPY $ for Org1, Org2, and Other in different colors. I want to be able to create  a pop up that shows the percentage of PMPY $ for each organization out of the total PMPY $ for that payment category (i.e. percentages for each bar should add up to 100).

Does anyone have any suggestions?

Thanks!

2 Replies
saurabh5
Creator II
Creator II

hi,

What if you check mark 'relative' in expression tab of the chart properties it would give you values in 100%.

Regards

saurabh

kmstephenson
Creator
Creator
Author

Yes, but I want to show the actual PMPY $ as well as the percentage so if I select relative for the bar chart it only shows the percentage. So I tried not selecting relative and creating a pop up with relative selected. However this is not working:

='# = '&$(vTotal#)&chr(10)
&'% of Total PMPY $ =' &
IF(Organization='Org1',((SUM({<Organization={'Org1'}>}pay_amt)/(SUM(TOTAL MemberMonths)))*12)/((SUM({<Organization>}pay_amt)/(SUM(TOTAL MemberMonths)))*12),
IF(Organization='Org2',((SUM({<Organization={'Org2'}>}pay_amt)/(SUM(TOTAL MemberMonths)))*12)/((SUM({<Organization>}pay_amt)/(SUM(TOTAL MemberMonths)))*12),
((
SUM({<Organization={'Other'}>}pay_amt)/(SUM(TOTAL MemberMonths)))*12)/((SUM({<Organization>}pay_amt)/(SUM(TOTAL MemberMonths)))*12)))

I would like both the PMPY $ and percentage of PMPY $ to be displayed in the pop ups