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

100% Stacked Bar Chart

Hi,

I need to build an Stacked Bar Chart where all bars sum 100%.

One dimention is Country and the other one is Type and the expresion its a count of Program.

The problem is with the denominator for the percentage because a program can be repeated for the same country and type since it can have different products

I tried with

COUNT (TOTAL <Country> Program)

AGGR(nodistinct COUNT(Program), Country)


 

Program Type Country Product
P1DIRECTUKPTE
P1DIRECTUKKMG
P2DIRECTUKASD
P2DIRECTUKPYU
P2DIRECTUKKMG
P2SECUKPTE
P3GRNTUKPYU
P3GRNTUKASD
P3GRNTUKKMG
P3DIRECTUKKMG
P3MRPUKPTE
P3MRPUKKMG
P3SECUKPYU

I attached the qvf and the excel with the graph that should be shown.

Thanks in advanced.

1 Reply
sunny_talwar

Try this

Count(DISTINCT Program)/Sum(TOTAL <Country> Aggr(Count(DISTINCT Program), Type, Country))


Capture.PNG