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

Show Percentage in Drill Down

I'm trying to figure out how to write an expression to show percentage.

In my data, I have a following dimensions:

Country

State

City

Name

LCode (Values will be something like C1,C2,C3,C4)

I want to show Graph of LCode = C4 as percentage of toatl number of rows for a given Country at first level. For example there 8 entries for India out of which 4 have LCode as C4 and 16 entries for China out of which 4 have LCode as C4 then I should get two bars in the graph. One of India and other for China and it should show C4% as 50%(i.e 4/8) for India and 25%(i.e 4/16) for China

Then similarly show of LCode = C4 as percentage of toatl number of rows for a given States at second level

I have created a Group of Country & State and I am able to show the individual count of C4 using expression Count({<[LCode] = {"C4"}>}[LCode]). However, I am unable to figure out expression to convert it to percentage of total number of rows in a country/state

Please can you help?

Regards

Akbar

1 Solution

Accepted Solutions
Gysbert_Wassenaar

try:

Count({<[LCode] = {"C4"}>} [LCode]) /  Count(total <Country> [LCode])

Count({<[LCode] = {"C4"}>} [LCode]) /  Count(total <Country,State> [LCode])

etc...


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

try:

Count({<[LCode] = {"C4"}>} [LCode]) /  Count(total <Country> [LCode])

Count({<[LCode] = {"C4"}>} [LCode]) /  Count(total <Country,State> [LCode])

etc...


talk is cheap, supply exceeds demand
jiwaniakbiar
Contributor II
Contributor II
Author

Thanks it worked.