Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
realmadridsi
New Contributor

Count if with unique values

Hello,

I've been using Qliksense for a while now and so far every issue I had i could solve by a blog post in this community, it is very helpful! Now however I came across something I can't figure out how to do this. I have millions of records in the following format:

 

Part IDFault code
1F01
2F01
3F03
3F02
4
5F03
5F02
5F01
6
7
8F03
8F02
9
10F01

I want to show a KPI of the 'touch' on part level and show it in % of total produced parts. Which means I have to count the amount of Unique Part ID's with a fault code and divide it by the total amount of Unique Part ID's.

In this example it would be 6 parts with a fault code (some with multiple fault codes but this doesn't matter for the touch %) of 10 total parts giving 60% touch.

I hope someone can help me with this.

Thanks for your help.

Geert

1 Solution

Accepted Solutions
mdmukramali
Valued Contributor III

Re: Count if with unique values

Hi,

try like this,

=Count({<Faultcode={'*'}>}Distinct PartID)

/

Count(Distinct PartID)

3 Replies
antoniotiman
Honored Contributor III

Re: Count if with unique values

May be this

Num(Count({<PartID={"=Len(Trim(MaxString(Faultcode))) > 0"}>} DISTINCT PartID)/Count(DISTINCT PartID),'#0 %')

Regards,

Antonio

mdmukramali
Valued Contributor III

Re: Count if with unique values

Hi,

try like this,

=Count({<Faultcode={'*'}>}Distinct PartID)

/

Count(Distinct PartID)

realmadridsi
New Contributor

Re: Count if with unique values

Hi,

Both solutions worked, thanks a lot!

Geert