Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

5 Replies
agigliotti
MVP
MVP

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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
MVP
MVP

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.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
mahitham
Creator II
Creator II
Author

Thank for your help. Its working