Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
akuttler
Creator
Creator

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
Creator III
Creator III

Hi Ashley,

Try this:

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

hope it helps...

View solution in original post

5 Replies
kaanerisen
Creator III
Creator III

Hi Ashley,

Try this:

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

hope it helps...

vikraant
Creator
Creator

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
Specialist
Specialist

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

akuttler
Creator
Creator
Author

Thank you all of your answers work

rupamjyotidas
Specialist
Specialist

Please close this post.