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 Calculation help

Hi Experts,

Can any one please help me on below requirement.

I have a Straight table like below.

ID           Sytemdate        startdate           Enddate          Flag

45689   29/06/2018     25/06/2018         30/06/2018        1       

45689   1/06/2018         2/06/2018           10/06/2018       0

78693    10/05/2018     11/06/2018        12/07/2018        0

78693    12/08/2018      2/06/2018           10/06/2018       0

 

Here Flag is calculated in UI like below

if(Sytemdate>=startdate      and  Sytemdate<=Enddate  ,'1' ,'0'  )

When Systemdate present in between Start and End dates then it has to show 1 else 0.

Requirement:

In a KPI how to calculate the  Number of Distinct IDs where Flag = '1'. Here flag is calculated in UI with above expression.

Cant apply the flag in backend.

Please help me on this.

 

Thanks in advance.

 

 

 

 

Labels (1)
1 Solution

Accepted Solutions
santhiqlik
Creator
Creator

Hi,
Please try this..
Count(Distinct if(Sytemdate>=startdate and Sytemdate<=Enddate, ID))

View solution in original post

4 Replies
santhiqlik
Creator
Creator

Hi,
Try this...

Count({<Sytemdate={">=startdate <=Enddate"}>} Distinct ID)
mahitham
Creator II
Creator II
Author

Hi @santhiqlik,
Thanks for your reply.
I have tried the above expression but KPI is showing 0 instead of 1.
santhiqlik
Creator
Creator

Hi,
Please try this..
Count(Distinct if(Sytemdate>=startdate and Sytemdate<=Enddate, ID))
mahitham
Creator II
Creator II
Author

Thanks for your help . Its working 🙂