Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

akuttler
Contributor

Set Modifier as a % of Total

Hello I have the following expression:

(Count({<CPT_CATEGORY={Cosmetic Procedure}>}distinct ENCID))/(Count(Distinct [ENCID]))

Its giving me an error.

I am trying to count Cosmetic ENCID's as a % of total ENCID's

Thanks.

1 Solution

Accepted Solutions
kaanerisen
Contributor III

Re: Set Modifier as a % of Total

Hi Ashley,

Try this:

Count({<CPT_CATEGORY={'Cosmetic Procedure'}>}distinct ENCID)/Count(Distinct [ENCID])

hope it helps...

5 Replies
kaanerisen
Contributor III

Re: Set Modifier as a % of Total

Hi Ashley,

Try this:

Count({<CPT_CATEGORY={'Cosmetic Procedure'}>}distinct ENCID)/Count(Distinct [ENCID])

hope it helps...

vikraant
Contributor

Re: Set Modifier as a % of Total

Hi Ashley,

It seems that its due to missing double quotes in the set modifier. If you wish to calculate percentage of cosmetic products against the total products, TOTAL could be used in the count aggregation.

(Count({<CPT_CATEGORY={'Cosmetic Procedure'}>}distinct ENCID))/(Count(TOTAL Distinct [ENCID]))

Alternatively, if you want to convert this to percentage, Num can be used .

Num(  (Count({<CPT_CATEGORY={'Cosmetic Procedure'}>}distinct ENCID))/(Count(TOTAL Distinct [ENCID]))  , '#.0%')

zebhashmi
Valued Contributor

Re: Set Modifier as a % of Total

=Count({<CPT_CATEGORY={'Cosmetic Procedure'}>}distinct ENCID)/Count(Distinct [ENCID])

akuttler
Contributor

Re: Set Modifier as a % of Total

Thank you all of your answers work

rupamjyotidas
Valued Contributor

Re: Set Modifier as a % of Total

Please close this post.

Community Browser