Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
neha2719
Contributor II
Contributor II

Help in creating chart with specific condition

Hi team

I have attached 1 dataset. Please look into this left side is input and right side its desired output. I need to create a chart compcode wise communication percentage. For 1 comp code there are multiple customers and for 1 customer there are multiple lines, if atleast one line hav enabled status it is considered as enabled and if none of the line have enabled it is considered as disabled.

Please let me know if any questions.

Please do not share the Qlik file as I wont be able to open it.

Thanks in advance.

Labels (3)
2 Solutions

Accepted Solutions
chrismarlow
Specialist II
Specialist II

Hi,

Maybe try;

Enabled =count(DISTINCT If(Communication='Enabled',Customer,Null()))/count(DISTINCT Customer)

Disabled =1-(count(DISTINCT If(Communication='Enabled',Customer,Null()))/count(DISTINCT Customer))

Cheers,

Chris.

View solution in original post

stevejoyce
Specialist II
Specialist II

Similar to @chrismarlow but with set analysis

Enabled =count(DISTINCT  {< Communication*={'Enabled'}  >}Customer )/count(DISTINCT Customer)

Disabled =1-(count(DISTINCT  {< Communication*={'Enabled'} >} Customer )/count(DISTINCT Customer))

View solution in original post

4 Replies
chrismarlow
Specialist II
Specialist II

Hi,

Maybe try;

Enabled =count(DISTINCT If(Communication='Enabled',Customer,Null()))/count(DISTINCT Customer)

Disabled =1-(count(DISTINCT If(Communication='Enabled',Customer,Null()))/count(DISTINCT Customer))

Cheers,

Chris.

stevejoyce
Specialist II
Specialist II

Similar to @chrismarlow but with set analysis

Enabled =count(DISTINCT  {< Communication*={'Enabled'}  >}Customer )/count(DISTINCT Customer)

Disabled =1-(count(DISTINCT  {< Communication*={'Enabled'} >} Customer )/count(DISTINCT Customer))

neha2719
Contributor II
Contributor II
Author

Thank you for reply this worked, i couldn't think of disabled expression we can write this. Thank you so much

neha2719
Contributor II
Contributor II
Author

Thank you Steve, this works perfectly, I couldnt think of that we can write expression for disabled in the same manner.