Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
P1 | DIRECT | UK | PTE |
P1 | DIRECT | UK | KMG |
P2 | DIRECT | UK | ASD |
P2 | DIRECT | UK | PYU |
P2 | DIRECT | UK | KMG |
P2 | SEC | UK | PTE |
P3 | GRNT | UK | PYU |
P3 | GRNT | UK | ASD |
P3 | GRNT | UK | KMG |
P3 | DIRECT | UK | KMG |
P3 | MRP | UK | PTE |
P3 | MRP | UK | KMG |
P3 | SEC | UK | PYU |
I attached the qvf and the excel with the graph that should be shown.
Thanks in advanced.
Try this
Count(DISTINCT Program)/Sum(TOTAL <Country> Aggr(Count(DISTINCT Program), Type, Country))