Qlik Community

Ask a Question

App Development

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

cancel
Showing results for 
Search instead for 
Did you mean: 
A7R3
Contributor III
Contributor III

KPI Count based on the measure

Hi,

I have the following data,

PartNumber   Supplier            Status    

A1                        S1                       Red
A1                        S2                       Green
A1                        S3                       Green
A2                        S4                       Red
A3                        S5                       Green
A3                        S6                       Green

With this as measure

= Count( {< Status={'Green'} >} distinct [PartNumber]) /   Count(distinct If( LEN(Status)>0, PartNumber))

I can create this table to report the Green status per the total, by PartNumber.

PartNumber    Status_Green    
A1                         66.6%                <- 2 out of 3 entries are green
A2                           0.0%                <- 0 out of 1 entries are green
A3                      100.0%                <- 2 out of 2 entries are green

How can I create a KPI to count the Part Numbers with Status_Green = 100%. In this case, the KPI = 1.

Thanks in advance for all the help.

 

 

Labels (4)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

@A7R3  Try:

=Count(DISTINCT {<PartNumber={"=Count( {<Status={'Green'}>} PartNumber)=Count( PartNumber)"}>}PartNumber )

View solution in original post

3 Replies
tresesco
MVP
MVP

@A7R3  Try:

=Count(DISTINCT {<PartNumber={"=Count( {<Status={'Green'}>} PartNumber)=Count( PartNumber)"}>}PartNumber )

View solution in original post

A7R3
Contributor III
Contributor III
Author

Hi Tresesco,

May I know how to read this expression?

The statement is structurally correct, but give a wrong number. I need to count the products when it meets the condition of all part number are having status of green.

I hope I can learn more to debug it. 

 

Thanks in advance

 

Kushal_Chawda

@A7R3  try below

=Count({<Status={'Green'}>}PartNumber)/Count(PartNumber)