Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to show percentage of Count?


Hi,

I have dimension Week  as =IF(FiscalWeekSerial>=$(curFiscalWeekSeq)-4,FiscalWeek) and expression Count as Count(DISTINCT {$<Chore={'Soaps'},Flag={2}>}ID)

it is working in Bar chart. But I need to show another expression as % of Count as another expression. I used below one but it is not working and showing error in expression.

Count(DISTINCT {$<Chore={'Soaps'},Flag={2}>} ID,'#,##0.00%')

Can anyone help me how to write correct expression to show percentage of count.

Thanks.

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Sorry, I forgot distinct:

Num(

Count(DISTINCT {$<Chore={'Soaps'},Flag={2}>} ID)

/

Count(TOTAL DISTINCT {$<Chore={'Soaps'},Flag={2}>} D)

,'#,##0.00%')

View solution in original post

12 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try

Count(DISTINCT {$<Chore={'Soaps'},Flag={2}>} ID,'#,##0.00%')

/

Count(TOTAL {$<Chore={'Soaps'},Flag={2}>} ID,'#,##0.00%')

Not applicable
Author

Thanks. Again it is showing error in expression. Any change in expression?

SunilChauhan
Champion
Champion

Count(DISTINCT {$<Chore={'Soaps'},Flag={2}>} ID)/Count(all {$<Chore={'Soaps'},Flag={2}>} ID)


chart properties-> number ->fixed to 2


hope this help

Sunil Chauhan
Not applicable
Author

will this work? as I tried this

Count(DISTINCT {$<Chore={'Soaps'},Flag={2}>} ID)

/

NUM(Count(TOTAL {$<Chore={'Soaps'},Flag={2}>} ID),'#,##0.00%')

alexandros17
Partner - Champion III
Partner - Champion III

Sorry, I forgot distinct:

Num(

Count(DISTINCT {$<Chore={'Soaps'},Flag={2}>} ID)

/

Count(TOTAL DISTINCT {$<Chore={'Soaps'},Flag={2}>} D)

,'#,##0.00%')

Not applicable
Author

Thanks.I used this. I have one doubt here.  If the count is 10. The percentage of count is showing 34% . Is that correct?

alexandros17
Partner - Champion III
Partner - Champion III

It depends on your data,

what we have done is divide count of your field by count of all the values, is this correct?

To understand better, use a chart with the same dimension and split the expression in two expressions,

one for the numerator and one for the denumerator, if data are correct, it is all ok

Not applicable
Author

Thanks. I need to show as only one expression. Is it possible?

alexandros17
Partner - Champion III
Partner - Champion III

Sure it is possible, but the purpose of the two expression is only to verify data.

The unique expression is numerator / denumerator