Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
jbakerstull
Creator
Creator

Incorrect count

I'm using set analysis expression below:

=Count({($<[Entry Date] = {"<=$(=EndDate)"}, [Entry Exit Has No Exit Date] = {'Yes'}>

+$<[Entry Date] = {"<=$(=EndDate)"}, [Exit Date] = {">=$(=StartDate)"}>

)*$<[Exit Destination] = {'Permanent housing (other than RRH) for formerly homeless persons (HUD)'}>}Distinct([Client Id]))

The formula returns 12, the data set only contains 9 values.

What I'm I doing incorrectly?

3 Replies
vamsee
Specialist
Specialist

Hello,

I would suggest you to create flags in the backend for

entry <= enddate,

exit>=start date


Like


IF([Entry Date] <= EndDate,1,0) as Entry_End_Flag,
IF([Exit Date] >=StartDate,1,0) as Exit_Start_Flag,


Also assuming    IF(len(Trim([Exit Date]))<1,'Yes', 'No') as [Entry Exit Has No Exit Date], /** this is the logic behind the field **/


In the chart try

=Count({

($<Entry_End_Flag={1}, [Entry Exit Has No Exit Date] = {'Yes'} +$<Entry_End_Flag={1}, Exit_Start_Flag={1}>)

*$<[Exit Destination] = {'Permanent housing (other than RRH) for formerly homeless persons (HUD)'}>}

Distinct ([Entry Exit Client Id]) )

jbakerstull
Creator
Creator
Author

Thank you for your suggestion. I'm don't have access to backend.

jbakerstull
Creator
Creator
Author

The issue is related to last record in the data set that is blank. I'm not certain why there is a blank row.

    

Entry Exit Client IdEntry Exit Provider NameEntry DateExit DateFormula
135781LSS - FM Faith on 8th5/23/20187/11/20181
83676LSS - FM Faith on 8th5/2/20187/26/20181
77068LSS - FM Faith on 8th5/1/20188/1/20181
5196LSS - FM Faith on 8th8/9/20188/10/20181
142643LSS - FM Faith on 8th9/1/20178/11/20181
71057LSS - FM Faith on 8th5/11/20188/17/20181
162330LSS - FM Faith on 8th8/9/20178/17/20181
66521LSS - FM Faith on 8th8/5/201810/22/20181
87056LSS - FM Faith on 8th6/3/201810/22/20181
----3