Headcount measure with multiple hiring and leaving dates
I have been trying to figure out headcount measure for more than 2 months in Qlik Sense, but I have not managed to do it. Particular problem with my employee database is that multiple people keep coming back to the company sometimes more than 3 times, so instead of a simple headcount measure which is just the count of number of names at a selected time point where the employee was hired before that date and have not yet left, a single employee can have multiple hiring dates and leaving dates so this is making it more difficult to write this measure. Anyway, I was able to write such measure in Power BI with correct outcome at any time periods, and I tried to replicate the measure in Qlik Sense as shown below, but the resultant table shows instead of the number of employees, it just shows the increment to the number of employees. So when looking at the number at the end, it agrees, but the period in between shows only the movement of the headcount.
I'd appreciate it if anyone could let me know how I can fix the formula above so that it counts the total number of employees at each period and not only the incremental changes.
it looks like your set modifiers are wrong. You need to adjust them to your data model. You might need to change the field name to the date field in your model. Make sure your Date field is a date and not a string.