Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ag732312
New Contributor II

How to obtain a percentage?

I am trying to get a percentage on a Qlik sense chart, but no matter what I do the percentage goes to 100%, I know the expression is correct as I tested in a different chart and it worked, Is theres an specific expression I could use to obtain a percentage out count expressions?

7 Replies

Re: How to obtain a percentage?

Can you provide sample for this.

hemeshreddy
New Contributor III

Re: How to obtain a percentage?

In the number format select number

and below to that select %

Re: How to obtain a percentage?

Hi, maybe the dimensions of this chart are different and the result is 100% in all.


What dimensions and expressions are you using?... A sample that demonstrates the problem will be better.

vvvvvvizard
Contributor III

Re: How to obtain a percentage?

=Sum(Your metric)/

Sum(Total your metric)

dont forget the total keyword

ag732312
New Contributor II

Re: How to obtain a percentage?

The dimension I am using :

=If(not Match(HC_Grade_category, 'Intern'), HC_Age_Category),  This is used to discard the value of Intern and show the rest.

The measure am using:

=count({$<HC_Worker_Type={'Employee'},HC_Age_Category={'below 30'}>} HC_Age_Category)/count({$<HC_Worker_Type={'Employee'}>} HC_Age_Category)

Re: How to obtain a percentage?

Hi Andres, I would try to split the expression in two expression:

- count({$<HC_Worker_Type={'Employee'},HC_Age_Category={'below 30'}>} HC_Age_Category)

- count({$<HC_Worker_Type={'Employee'}>} HC_Age_Category)


Then you can check if you are getting the expected values, if now you are getting 100% in all cells then it should be the same value in both expressions.


You can also add HC_Worker_Type and HC_Age_Category as dimensions to trace the results.

ag732312
New Contributor II

Re: How to obtain a percentage?

Thanks @ Ruben Marin,

I fix it by count( Total:   "count(total{$<HC_Worker_Type={'Employee'}>} HC_Age_Category)"