Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arixooo123
Creator III
Creator III

Wrong Percentage in stacked bar chart

I like to see the share of category A in category B, For example category A is Sex( Male,Female ) and Category B is opinion (good,bad).

i did the following :

I have added Sex and Opinion columns as Dimensions

in Expression Tab :

Expression One: 

1     

(Bar)

Expression Two:

COUNT(DISTINCT People)/Count(TOTAL <Sex> DISTINCT People)

(Values On Data Point)

The problem is the sum of each stack is more than 100% . what's the reason?

Untitled.png

1 Solution

Accepted Solutions
jyothish8807
Master II
Master II

Hi,

PFA.

Regards

KC

Best Regards,
KC

View solution in original post

11 Replies
Not applicable

Dear Arman,

Can you please add data table related to this query.

Thanks & Regards

Prince Anand

arixooo123
Creator III
Creator III
Author

I can share some of the table...but is it because of the data or there is something wrong with my query?

How is it possible to have aggregate percentage more than 100%?  

arixooo123
Creator III
Creator III
Author

here is the sample file

jyothish8807
Master II
Master II

Hi arman,

just reverse your expression.

make your denominator as numerator and vice versa.

Regards

KC

Best Regards,
KC
arixooo123
Creator III
Creator III
Author

Thanks Buddy,

But i'm not sure i got what you said. Based on sample data i want to see the share of Remark Column (Active&Deactive) in the ValuableAtAll Column (Yes/No) . 

So i added ValuableAtAll and Remark As the dimension. then i

COUNT(DISTINCT SubID)/Count(TOTAL<ValuableAtall> DISTINCT SubID)

in the expression

jyothish8807
Master II
Master II

Hi arman,

try this:

Count(TOTAL<ValuableAtall> DISTINCT SubID)/COUNT(DISTINCT SubID)


Regards

KC

Best Regards,
KC
arixooo123
Creator III
Creator III
Author

see what happened :

new.PNG.png

jyothish8807
Master II
Master II

Hi Arman,

try this,hope it works

in Dimension:

Valuableatall

exp1:

Count({<REMARK={'Active'}>} SUB_ID)/Count(SUB_ID)

exp2:

Count({<REMARK={'Deactive'}>} SUB_ID)/Count( SUB_ID)

Regards

KC

Best Regards,
KC
jyothish8807
Master II
Master II

Hi,

PFA.

Regards

KC

Best Regards,
KC