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: 
mahitham
Creator II
Creator II

KPI Expression help

Hi Experts,

Can any one please help me on below requirement.

In the attached image KPI I have used the below expression

=if(len(GetFieldSelections(EmpTYPE))=0,
Count({<Flag={'Completed'}>}distinct EmpID),

if(GetFieldSelections(EmpTYPE)='New','N/A',

if(GetFieldSelections(EmpTYPE)='Permanents',
Count({<Flag={'Completed'}>}distinct EmpID)
)))

as per this expression when user selects EmpType = New then in the KPI instead of 0 I am passing N/A

Same like when user selects New EmpType related any employee Id then also this KPI has to show N/A instead of 0 value.

KPI.png

Please help me on this. Please find the below attached app.

Note: I am looking for the solution only in Front end.

Thank in advance

1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:

=if(len(GetFieldSelections(EmpTYPE))=0 and EmpTYPE<>'New',

Count({<Flag={'Completed'}>}distinct EmpID),

if(GetFieldSelections(EmpTYPE)='New' or EmpTYPE='New','N/A',

if(GetFieldSelections(EmpTYPE)='Permanents',

Count({<Flag={'Completed'}>}distinct EmpID) )

        )

)

I hope it helps.

View solution in original post

5 Replies
agigliotti
Partner - Champion
Partner - Champion

your KPI expression looks good, what's your expected result?

andrey_krylov
Specialist
Specialist

Hi Mahitha. Try this

=if(EmpTYPE='New','N/A',

if(len(GetFieldSelections(EmpTYPE))=0,

Count({<Flag={'Completed'}>}distinct EmpID),

if(GetFieldSelections(EmpTYPE)='Permanents',
Count({<Flag={'Completed'}>}distinct EmpID)
)))

mahitham
Creator II
Creator II
Author

Hi agigliotti


I have mainly two filters Emp Type and Emp Id.

User either selects Emp Type or Emp Id.


Requirement is when user select EmpType = New then need to show N/A in the KPI

if user selects any EmpID related to EmpType = New then also need to show N/A in the KPI

by default need to show actual count.

NA.png

agigliotti
Partner - Champion
Partner - Champion

maybe this:

=if(len(GetFieldSelections(EmpTYPE))=0 and EmpTYPE<>'New',

Count({<Flag={'Completed'}>}distinct EmpID),

if(GetFieldSelections(EmpTYPE)='New' or EmpTYPE='New','N/A',

if(GetFieldSelections(EmpTYPE)='Permanents',

Count({<Flag={'Completed'}>}distinct EmpID) )

        )

)

I hope it helps.

mahitham
Creator II
Creator II
Author

Thank for your help. Its working